Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate function uss_tag_encoding from encode utils #753

Merged
merged 2 commits into from
Apr 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions plugins/module_utils/encode.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,25 +496,6 @@ def uss_file_tag(self, file_path):
except Exception:
return None

def uss_tag_encoding(self, file_path, tag):
"""Tag the file/directory specified with the given code set.
If `file_path` is a directory, all of the files and subdirectories will
be tagged recursively.

Arguments:
file_path {str} -- Absolute file path to tag.
tag {str} -- Code set to tag the file/directory.

Raises:
TaggingError: When the chtag command fails.
"""
is_dir = os.path.isdir(file_path)

tag_cmd = "chtag -{0}c {1} {2}".format("R" if is_dir else "t", tag, file_path)
rc, out, err = self.module.run_command(tag_cmd)
if rc != 0:
raise TaggingError(file_path, tag, rc, out, err)


class EncodeError(Exception):
def __init__(self, message):
Expand Down