]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
library: remove unused module import
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 27 Oct 2020 16:14:19 +0000 (12:14 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 2 Aug 2021 13:53:00 +0000 (15:53 +0200)
Move the import at the top of the file and remove unused module import.

- E402 module level import not at top of file
- F401 'xxxx' imported but unused

This also removes the '# noqa E402' statement from the code.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 2138a00a3294b222d5e8325495300841ed5a7f5f)

library/ceph_key.py
library/ceph_volume.py

index 9ccb6384b960c3a217abda8f456d87968ba808b1..38b661cc45d3b544690f53a50de1ec9867cf8447 100644 (file)
 from __future__ import absolute_import, division, print_function
 __metaclass__ = type
 
+from ansible.module_utils.basic import AnsibleModule
+import datetime
+import json
+import os
+import struct
+import time
+import base64
+import socket
+
 
 ANSIBLE_METADATA = {
     'metadata_version': '1.1',
@@ -175,17 +184,6 @@ caps:
 
 RETURN = '''#  '''
 
-from ansible.module_utils.basic import AnsibleModule  # noqa: E402
-import datetime  # noqa: E402
-import grp  # noqa: E402
-import json  # noqa: E402
-import os  # noqa: E402
-import pwd  # noqa: E402
-import stat  # noqa: E402
-import struct  # noqa: E402
-import time  # noqa: E402
-import base64  # noqa: E402
-import socket  # noqa: E402
 
 CEPH_INITIAL_KEYS = ['client.admin', 'client.bootstrap-mds', 'client.bootstrap-mgr',  # noqa: E501
                      'client.bootstrap-osd', 'client.bootstrap-rbd', 'client.bootstrap-rbd-mirror', 'client.bootstrap-rgw']  # noqa: E501
index 68d7fc68234bbfe1559dcc1d56689ec4d8739c7b..97546b2f4c5ef9db8ff2b3bdfbeea2352d2f6b88 100644 (file)
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 
+from ansible.module_utils.basic import AnsibleModule
 import datetime
 import copy
 import json
@@ -179,9 +180,6 @@ EXAMPLES = '''
 '''
 
 
-from ansible.module_utils.basic import AnsibleModule  # noqa: E402
-
-
 def fatal(message, module):
     '''
     Report a fatal error and exit