From 82211c97d86ee9a7352865ef66dd2648a7c1edf0 Mon Sep 17 00:00:00 2001 From: Jose Delarosa Date: Fri, 22 Jun 2018 14:08:18 -0500 Subject: [PATCH] Removed unused variable definitions and library imports --- lib/ansible/module_utils/redfish_utils.py | 12 ------------ .../remote_management/redfish/redfish_facts.py | 6 ++---- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/ansible/module_utils/redfish_utils.py b/lib/ansible/module_utils/redfish_utils.py index bd443ba7f97..5bacac9cc4c 100644 --- a/lib/ansible/module_utils/redfish_utils.py +++ b/lib/ansible/module_utils/redfish_utils.py @@ -190,7 +190,6 @@ class RedfishUtils(object): def get_logs(self): log_svcs_uri_list = [] list_of_logs = [] - result = {} # Find LogService response = self.get_request(self.root_uri + self.manager_uri) @@ -238,8 +237,6 @@ class RedfishUtils(object): return {'ret': True, 'list_of_logs': list_of_logs} def clear_logs(self): - result = {} - # Find LogService response = self.get_request(self.root_uri + self.manager_uri) if response['ret'] is False: @@ -402,7 +399,6 @@ class RedfishUtils(object): def list_users(self): # listing all users has always been slower than other operations, why? - result = {} allusers = [] allusers_details = [] response = self.get_request(self.root_uri + self.accounts_uri) @@ -430,7 +426,6 @@ class RedfishUtils(object): return {'ret': True, 'entries': allusers_details} def add_user(self, user): - result = {} uri = self.root_uri + self.accounts_uri + "/" + user['userid'] username = {'UserName': user['username']} pswd = {'Password': user['userpswd']} @@ -443,7 +438,6 @@ class RedfishUtils(object): return {'ret': True} def enable_user(self, user): - result = {} uri = self.root_uri + self.accounts_uri + "/" + user['userid'] payload = {'Enabled': True} response = self.patch_request(uri, payload, HEADERS) @@ -452,7 +446,6 @@ class RedfishUtils(object): return {'ret': True} def delete_user(self, user): - result = {} uri = self.root_uri + self.accounts_uri + "/" + user['userid'] payload = {'UserName': ""} response = self.patch_request(uri, payload, HEADERS) @@ -461,7 +454,6 @@ class RedfishUtils(object): return {'ret': True} def disable_user(self, user): - result = {} uri = self.root_uri + self.accounts_uri + "/" + user['userid'] payload = {'Enabled': False} response = self.patch_request(uri, payload, HEADERS) @@ -470,7 +462,6 @@ class RedfishUtils(object): return {'ret': True} def update_user_role(self, user): - result = {} uri = self.root_uri + self.accounts_uri + "/" + user['userid'] payload = {'RoleId': user['userrole']} response = self.patch_request(uri, payload, HEADERS) @@ -479,7 +470,6 @@ class RedfishUtils(object): return {'ret': True} def update_user_password(self, user): - result = {} uri = self.root_uri + self.accounts_uri + "/" + user['userid'] payload = {'Password': user['userpswd']} response = self.patch_request(uri, payload, HEADERS) @@ -489,7 +479,6 @@ class RedfishUtils(object): def get_firmware_inventory(self): result = {} - devices = [] response = self.get_request(self.root_uri + self.firmware_uri) if response['ret'] is False: return response @@ -640,7 +629,6 @@ class RedfishUtils(object): return {'ret': True} def set_manager_attributes(self, attr): - result = {} attributes = "Attributes" # Example: manager_attr = {\"name\":\"value\"} diff --git a/lib/ansible/modules/remote_management/redfish/redfish_facts.py b/lib/ansible/modules/remote_management/redfish/redfish_facts.py index a8b23c543b6..e0e24d665eb 100644 --- a/lib/ansible/modules/remote_management/redfish/redfish_facts.py +++ b/lib/ansible/modules/remote_management/redfish/redfish_facts.py @@ -25,7 +25,7 @@ options: required: true description: - Action category to execute on server - choices: ["Inventory", "Accounts", "System", "Update", "Manager", "Chassis"] + choices: ["Inventory", "Accounts", "System", "Update", "Manager"] command: required: true description: @@ -88,8 +88,6 @@ result: sample: List of CPUs on system ''' -import os -import json from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.redfish_utils import RedfishUtils @@ -98,7 +96,7 @@ def main(): result = {} module = AnsibleModule( argument_spec=dict( - category=dict(required=True, choices=["Inventory", "Accounts", "System", "Update", "Manager", "Chassis"]), + category=dict(required=True, choices=["Inventory", "Accounts", "System", "Update", "Manager"]), command=dict(), baseuri=dict(required=True), user=dict(required=True),