Fix linter issues on iscsi modules.
Signed-off-by: Sébastien Han <seb@redhat.com>
"""
-import os
-import logging
-from logging.handlers import RotatingFileHandler
-from ansible.module_utils.basic import *
+import os # noqa E402
+import logging # noqa E402
+from logging.handlers import RotatingFileHandler # noqa E402
+from ansible.module_utils.basic import * # noqa E402
+
+from ceph_iscsi_config.client import GWClient # noqa E402
+import ceph_iscsi_config.settings as settings # noqa E402
-from ceph_iscsi_config.client import GWClient
-import ceph_iscsi_config.settings as settings
# the main function is called ansible_main to allow the call stack
# to be checked to determine whether the call to the ceph_iscsi_config
"required": True,
"choices": ['present', 'absent'],
"type": "str"
- },
- }
+ },
+ }
- module = AnsibleModule(argument_spec=fields,
+ module = AnsibleModule(argument_spec=fields, # noqa F405
supports_check_mode=False)
client_iqn = module.params['client_iqn']
meta={"msg": "Client definition completed {} "
"changes made".format(client.change_count)})
+
if __name__ == '__main__':
module_name = os.path.basename(__file__).replace('ansible_module_', '')
"""
-import os
-import logging
+import os # noqa E402
+import logging # noqa E402
-from logging.handlers import RotatingFileHandler
-from ansible.module_utils.basic import *
+from logging.handlers import RotatingFileHandler # noqa E402
+from ansible.module_utils.basic import * # noqa E402
-import ceph_iscsi_config.settings as settings
+import ceph_iscsi_config.settings as settings # noqa E402
-from ceph_iscsi_config.gateway import GWTarget
-from ceph_iscsi_config.utils import valid_ip
+from ceph_iscsi_config.gateway import GWTarget # noqa E402
+from ceph_iscsi_config.utils import valid_ip # noqa E402
# the main function is called ansible_main to allow the call stack
"mode": {
"required": True,
"choices": ['target', 'map']
- }
- }
+ }
+ }
- module = AnsibleModule(argument_spec=fields,
+ module = AnsibleModule(argument_spec=fields, # noqa F405
supports_check_mode=False)
gateway_iqn = module.params['gateway_iqn']
module.fail_json(msg="iSCSI gateway creation/load failure "
"({})".format(gateway.error_msg))
-
logger.info("END - GATEWAY configuration complete")
module.exit_json(changed=gateway.changes_made,
meta={"msg": "Gateway setup complete"})
short_description: Manage ceph rbd images to present as iscsi LUNs to clients
description:
- This module calls the 'lun' configuration management module installed
- on the iscsi gateway node(s). The lun module handles the creation and resize
+ on the iscsi gateway node(s). The lun module handles the creation and resize # noqa E501
of rbd images, and then maps these rbd devices to the gateway node(s) to be
exposed through the kernel's LIO target.
- To support module debugging, this module logs to /var/log/ansible-module-igw_config.log
+ To support module debugging, this module logs to /var/log/ansible-module-igw_config.log # noqa E501
on the target machine(s).
option:
- 'Paul Cuzner'
"""
-import os
-import logging
-from logging.handlers import RotatingFileHandler
+import os # noqa E402
+import logging # noqa E402
+from logging.handlers import RotatingFileHandler # noqa E402
-from ansible.module_utils.basic import *
+from ansible.module_utils.basic import * # noqa E402
-from ceph_iscsi_config.lun import LUN
-from ceph_iscsi_config.utils import valid_size
-import ceph_iscsi_config.settings as settings
+from ceph_iscsi_config.lun import LUN # noqa E402
+from ceph_iscsi_config.utils import valid_size # noqa E402
+import ceph_iscsi_config.settings as settings # noqa E402
# the main function is called ansible_main to allow the call stack
# to be checked to determine whether the call to the ceph_iscsi_config
# modules is from ansible or not
+
+
def ansible_main():
# Define the fields needs to create/map rbd's the the host(s)
}
# not supporting check mode currently
- module = AnsibleModule(argument_spec=fields,
+ module = AnsibleModule(argument_spec=fields, # noqa F405
supports_check_mode=False)
pool = module.params["pool"]
"""
-import os
-import logging
-from logging.handlers import RotatingFileHandler
-from ansible.module_utils.basic import *
+import os # noqa E402
+import logging # noqa E402
+from logging.handlers import RotatingFileHandler # noqa E402
+from ansible.module_utils.basic import * # noqa E402
+
+from ceph_iscsi_config.client import GWClient # noqa E402
+import ceph_iscsi_config.settings as settings # noqa E402
-from ceph_iscsi_config.client import GWClient
-import ceph_iscsi_config.settings as settings
# the main function is called ansible_main to allow the call stack
# to be checked to determine whether the call to the ceph_iscsi_config
"required": True,
"choices": ['present', 'absent'],
"type": "str"
- },
- }
+ },
+ }
- module = AnsibleModule(argument_spec=fields,
+ module = AnsibleModule(argument_spec=fields, # noqa F405
supports_check_mode=False)
client_iqn = module.params['client_iqn']
meta={"msg": "Client definition completed {} "
"changes made".format(client.change_count)})
+
if __name__ == '__main__':
module_name = os.path.basename(__file__).replace('ansible_module_', '')
"""
-import os
-import logging
+import os # noqa E402
+import logging # noqa E402
-from logging.handlers import RotatingFileHandler
-from ansible.module_utils.basic import *
+from logging.handlers import RotatingFileHandler # noqa E402
+from ansible.module_utils.basic import * # noqa E402
-import ceph_iscsi_config.settings as settings
+import ceph_iscsi_config.settings as settings # noqa E402
-from ceph_iscsi_config.gateway import GWTarget
-from ceph_iscsi_config.utils import valid_ip
+from ceph_iscsi_config.gateway import GWTarget # noqa E402
+from ceph_iscsi_config.utils import valid_ip # noqa E402
# the main function is called ansible_main to allow the call stack
"mode": {
"required": True,
"choices": ['target', 'map']
- }
- }
+ }
+ }
- module = AnsibleModule(argument_spec=fields,
+ module = AnsibleModule(argument_spec=fields, # noqa F405
supports_check_mode=False)
gateway_iqn = module.params['gateway_iqn']
module.fail_json(msg="iSCSI gateway creation/load failure "
"({})".format(gateway.error_msg))
-
logger.info("END - GATEWAY configuration complete")
module.exit_json(changed=gateway.changes_made,
meta={"msg": "Gateway setup complete"})
short_description: Manage ceph rbd images to present as iscsi LUNs to clients
description:
- This module calls the 'lun' configuration management module installed
- on the iscsi gateway node(s). The lun module handles the creation and resize
+ on the iscsi gateway node(s). The lun module handles the creation and resize # noqa E501
of rbd images, and then maps these rbd devices to the gateway node(s) to be
exposed through the kernel's LIO target.
- To support module debugging, this module logs to /var/log/ansible-module-igw_config.log
+ To support module debugging, this module logs to /var/log/ansible-module-igw_config.log # noqa E501
on the target machine(s).
option:
- 'Paul Cuzner'
"""
-import os
-import logging
-from logging.handlers import RotatingFileHandler
+import os # noqa E402
+import logging # noqa E402
+from logging.handlers import RotatingFileHandler # noqa E402
-from ansible.module_utils.basic import *
+from ansible.module_utils.basic import * # noqa E402
-from ceph_iscsi_config.lun import LUN
-from ceph_iscsi_config.utils import valid_size
-import ceph_iscsi_config.settings as settings
+from ceph_iscsi_config.lun import LUN # noqa E402
+from ceph_iscsi_config.utils import valid_size # noqa E402
+import ceph_iscsi_config.settings as settings # noqa E402
# the main function is called ansible_main to allow the call stack
# to be checked to determine whether the call to the ceph_iscsi_config
# modules is from ansible or not
+
+
def ansible_main():
# Define the fields needs to create/map rbd's the the host(s)
}
# not supporting check mode currently
- module = AnsibleModule(argument_spec=fields,
+ module = AnsibleModule(argument_spec=fields, # noqa F405
supports_check_mode=False)
pool = module.params["pool"]