From 1270d5964aac89257b2ddc876cc388a68cc10662 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 27 Oct 2020 12:14:19 -0400 Subject: [PATCH] library: remove unused module import 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 (cherry picked from commit 2138a00a3294b222d5e8325495300841ed5a7f5f) --- library/ceph_key.py | 20 +++++++++----------- library/ceph_volume.py | 4 +--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/library/ceph_key.py b/library/ceph_key.py index 9ccb6384b..38b661cc4 100644 --- a/library/ceph_key.py +++ b/library/ceph_key.py @@ -17,6 +17,15 @@ 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 diff --git a/library/ceph_volume.py b/library/ceph_volume.py index 68d7fc682..97546b2f4 100644 --- a/library/ceph_volume.py +++ b/library/ceph_volume.py @@ -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 -- 2.39.5