diff --git a/changelogs/fragments/1336-update-docstring-validation.yml b/changelogs/fragments/1336-update-docstring-validation.yml index ef7ee85f8..547103d46 100644 --- a/changelogs/fragments/1336-update-docstring-validation.yml +++ b/changelogs/fragments/1336-update-docstring-validation.yml @@ -1,3 +1,3 @@ trivial: - - validation - Updated docstrings to google style for visual aid to developers. + - validation - Updated docstrings to numpy style for visual aid to developers. (https://github.com/ansible-collections/ibm_zos_core/pull/1336). \ No newline at end of file diff --git a/plugins/module_utils/validation.py b/plugins/module_utils/validation.py index ba2c0411a..171f8d360 100644 --- a/plugins/module_utils/validation.py +++ b/plugins/module_utils/validation.py @@ -27,14 +27,20 @@ def validate_safe_path(path): In this action plugin, path is on the controller. - Arguments: - path {str} -- A file's path. + Parameters + ---------- + path : str + A file's path. - Returns: - str -- The introduced path + Returns + ------- + str + The introduced path - Raises: - DirectoryTraversalError: User does not have access to a directory. + Raises + ------ + DirectoryTraversalError + User does not have access to a directory. """ if not os.path.isabs(path): real_path = os.path.realpath(path) @@ -49,11 +55,15 @@ def validate_safe_path(path): class DirectoryTraversalError(Exception): """User does not have access to a directory. - Arguments: - path {str} -- Directory path. - - Attributes: - msg {str} -- Human readable string describing the exception. + Parameters + ---------- + path : str + Directory path. + + Attributes + ---------- + msg : str + Human readable string describing the exception. """ def __init__(self, path): self.msg = "Detected directory traversal, user does not have access to {0}".format(path)