mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
pep8 fixes for vmware modules (#31537)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
e7145e249f
commit
9d811a34c4
9 changed files with 42 additions and 41 deletions
|
@ -74,6 +74,7 @@ from ansible.module_utils.vmware import HAS_PYVMOMI, connect_to_api, vmware_argu
|
|||
|
||||
|
||||
class VMwareLocalUserManager(object):
|
||||
|
||||
def __init__(self, module):
|
||||
self.module = module
|
||||
self.content = connect_to_api(self.module)
|
||||
|
@ -103,7 +104,6 @@ class VMwareLocalUserManager(object):
|
|||
except Exception as e:
|
||||
self.module.fail_json(msg=str(e))
|
||||
|
||||
|
||||
def check_local_user_manager_state(self):
|
||||
user_account = self.find_user_account()
|
||||
if not user_account:
|
||||
|
@ -111,7 +111,6 @@ class VMwareLocalUserManager(object):
|
|||
else:
|
||||
return 'present'
|
||||
|
||||
|
||||
def find_user_account(self):
|
||||
searchStr = self.local_user_name
|
||||
exactMatch = True
|
||||
|
@ -120,7 +119,6 @@ class VMwareLocalUserManager(object):
|
|||
user_account = self.content.userDirectory.RetrieveUserGroups(None, searchStr, None, None, exactMatch, findUsers, findGroups)
|
||||
return user_account
|
||||
|
||||
|
||||
def create_account_spec(self):
|
||||
account_spec = vim.host.LocalAccountManager.AccountSpecification()
|
||||
account_spec.id = self.local_user_name
|
||||
|
@ -128,7 +126,6 @@ class VMwareLocalUserManager(object):
|
|||
account_spec.description = self.local_user_description
|
||||
return account_spec
|
||||
|
||||
|
||||
def state_create_user(self):
|
||||
account_spec = self.create_account_spec()
|
||||
|
||||
|
@ -151,7 +148,6 @@ class VMwareLocalUserManager(object):
|
|||
except vmodl.MethodFault as method_fault:
|
||||
self.module.fail_json(msg=method_fault.msg)
|
||||
|
||||
|
||||
def state_remove_user(self):
|
||||
try:
|
||||
self.content.accountManager.RemoveUser(self.local_user_name)
|
||||
|
@ -161,12 +157,10 @@ class VMwareLocalUserManager(object):
|
|||
except vmodl.MethodFault as method_fault:
|
||||
self.module.fail_json(msg=method_fault.msg)
|
||||
|
||||
|
||||
def state_exit_unchanged(self):
|
||||
self.module.exit_json(changed=False)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
argument_spec = vmware_argument_spec()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue