Fixes multiple lgtm issues (#45629)

Most of the issues were just inclusions of code that were not used.
This cleans those up. Other alerts were semi-false-positives for now
This commit is contained in:
Tim Rupp
2018-09-13 15:26:17 -04:00
committed by GitHub
parent e68f895e61
commit e619052424
40 changed files with 255 additions and 239 deletions

View File

@@ -95,7 +95,6 @@ try:
from library.module_utils.network.f5.common import F5ModuleError
from library.module_utils.network.f5.common import AnsibleF5Parameters
from library.module_utils.network.f5.common import cleanup_tokens
from library.module_utils.network.f5.common import fq_name
from library.module_utils.network.f5.common import f5_argument_spec
from library.module_utils.network.f5.common import exit_json
from library.module_utils.network.f5.common import fail_json
@@ -105,7 +104,6 @@ except ImportError:
from ansible.module_utils.network.f5.common import F5ModuleError
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
from ansible.module_utils.network.f5.common import cleanup_tokens
from ansible.module_utils.network.f5.common import fq_name
from ansible.module_utils.network.f5.common import f5_argument_spec
from ansible.module_utils.network.f5.common import exit_json
from ansible.module_utils.network.f5.common import fail_json
@@ -401,7 +399,7 @@ class ModuleManager(object):
if resp.status == 200:
return True
def read_current_from_device(self):
def read_current_from_device(self): # lgtm [py/similar-function]
uri = "https://{0}:{1}/mgmt/tm/cli/script/{2}".format(
self.client.provider['server'],
self.client.provider['server_port'],
@@ -454,8 +452,10 @@ def main():
client = F5RestClient(**module.params)
mm = ModuleManager(module=module, client=client)
results = mm.exec_module()
cleanup_tokens(client)
exit_json(module, results, client)
except F5ModuleError as ex:
cleanup_tokens(client)
fail_json(module, ex, client)