Skip to content

Commit

Permalink
Modify google style to numpy
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacVRey committed Apr 2, 2024
1 parent d4b2238 commit 1dcfe70
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 44 deletions.
2 changes: 1 addition & 1 deletion changelogs/fragments/1356-update-docstring-zos_mount.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
trivial:
- zos_mount - Updated docstrings to google style for visual aid to developers.
- zos_mount - Updated docstrings to numpy style for visual aid to developers.
(https://github.com/ansible-collections/ibm_zos_core/pull/1356).
115 changes: 72 additions & 43 deletions plugins/modules/zos_mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,20 +564,30 @@


def mt_backupOper(module, src, backup, tmphlq=None):
"""Makes a backup of the source
Arguments:
module {AnsibleModule} -- AnsibleModule
src {str} -- Source of the file
backup {str} -- Name for the backup
tmphlq {str} -- HLQ to be used for backup dataset
Returns:
str -- Backup name
Raises:
fail_json: Crating backup has failed
fail_json: Data set type is NOT supported
"""Makes a backup of the source.
Parameters
----------
module : AnsibleModule
AnsibleModule.
src : str
Source of the file.
backup : str
Name for the backup.
tmphlq : str
HLQ to be used for backup dataset.
Returns
-------
str
Backup name.
Raises
------
fail_json
Crating backup has failed.
fail_json
Data set type is NOT supported.
"""
# analysis the file type
ds_utils = data_set.DataSetUtils(src)
Expand Down Expand Up @@ -606,17 +616,23 @@ def mt_backupOper(module, src, backup, tmphlq=None):

def swap_text(original, adding, removing):
"""swap_text returns original after removing blocks matching removing,
and adding the adding param
original now should be a list of lines without newlines
return is the consolidated file value
Arguments:
original {str} -- Text to modify
adding {str} -- Lines to add
removing {str} -- Lines to delete if matched
Returns:
str -- The consolidated file value
and adding the adding param.
original now should be a list of lines without newlines.
return is the consolidated file value.
Parameters
----------
original : str
Text to modify.
adding : str
Lines to add.
removing : str
Lines to delete if matched.
Returns
-------
str
The consolidated file value.
"""
content_lines = original

Expand Down Expand Up @@ -680,23 +696,36 @@ def swap_text(original, adding, removing):


def run_module(module, arg_def):
"""Initialize module
Arguments:
arg_def {dict} -- Arguments to use
Returns:
dict -- Arguments
Raises:
fail_json: Parameter verification failed
fail_json: Mount source either is not cataloged or does not exist.
fail_json: Exception encountered during directory creation
fail_json: Mount destination doesn't exist
fail_json: Checking filesystem list failed with error
fail_json: Exception encountered when running unmount
fail_json: Exception occurrend when running mount
fail_json: Persistent data set is either not cataloged or does not exist
"""Initialize module.
Parameters
----------
arg_def : dict
Arguments to use.
Returns
-------
dict
Arguments.
Raises
------
fail_json
Parameter verification failed.
fail_json
Mount source either is not cataloged or does not exist.
fail_json
Exception encountered during directory creation.
fail_json
Mount destination doesn't exist.
fail_json
Checking filesystem list failed with error.
fail_json
Exception encountered when running unmount.
fail_json
Exception occurred when running mount.
fail_json
Persistent data set is either not cataloged or does not exist.
"""
# ********************************************************************
# Verify the validity of module args. BetterArgParser raises ValueError
Expand Down Expand Up @@ -1082,7 +1111,7 @@ def run_module(module, arg_def):


def main():
"""Initialize module when executed as main
"""Initialize module when executed as main.
"""
global module

Expand Down

0 comments on commit 1dcfe70

Please sign in to comment.