mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-24 18:09:10 -07:00
Refactors main() function and module manager in multiple modules in line with recent changes (#53984)
Adds variable types to docs Refactors unit tests to remove deprecated parameters
This commit is contained in:
parent
ab238071e3
commit
9a007799d4
32 changed files with 627 additions and 465 deletions
|
@ -115,10 +115,12 @@ class TestManager(unittest.TestCase):
|
|||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
partition_access=access,
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin',
|
||||
update_password='on_create'
|
||||
update_password='on_create',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -145,9 +147,11 @@ class TestManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
partition_access=access,
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -172,9 +176,11 @@ class TestManager(unittest.TestCase):
|
|||
def test_create_user_partition_access_raises(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -204,11 +210,13 @@ class TestManager(unittest.TestCase):
|
|||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
partition_access=access,
|
||||
password='password',
|
||||
server='localhost',
|
||||
update_password='on_create',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -237,10 +245,12 @@ class TestManager(unittest.TestCase):
|
|||
password_credential='testpass',
|
||||
partition_access=access,
|
||||
update_password='on_create',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -268,9 +278,11 @@ class TestManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -300,9 +312,11 @@ class TestManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -331,10 +345,12 @@ class TestManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_none(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='none'
|
||||
shell='none',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -369,10 +385,12 @@ class TestManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_none_shell_attribute_missing(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='none'
|
||||
shell='none',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -408,10 +426,12 @@ class TestManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_bash(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -448,10 +468,12 @@ class TestManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_bash_mutliple_roles(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -502,10 +524,12 @@ class TestLegacyManager(unittest.TestCase):
|
|||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
partition_access=access,
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin',
|
||||
update_password='on_create'
|
||||
update_password='on_create',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -532,9 +556,11 @@ class TestLegacyManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
partition_access=access,
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -559,9 +585,11 @@ class TestLegacyManager(unittest.TestCase):
|
|||
def test_create_user_partition_access_raises(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -591,11 +619,13 @@ class TestLegacyManager(unittest.TestCase):
|
|||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
partition_access=access,
|
||||
password='password',
|
||||
server='localhost',
|
||||
update_password='on_create',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -624,10 +654,12 @@ class TestLegacyManager(unittest.TestCase):
|
|||
password_credential='testpass',
|
||||
partition_access=access,
|
||||
update_password='on_create',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -655,9 +687,11 @@ class TestLegacyManager(unittest.TestCase):
|
|||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password_credential='testpass',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin'
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -692,10 +726,12 @@ class TestLegacyManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_none(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='none'
|
||||
shell='none',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -730,10 +766,12 @@ class TestLegacyManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_none_shell_attribute_missing(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='none'
|
||||
shell='none',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -769,10 +807,12 @@ class TestLegacyManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_bash(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
@ -809,10 +849,12 @@ class TestLegacyManager(unittest.TestCase):
|
|||
def test_update_user_shell_to_bash_mutliple_roles(self, *args):
|
||||
set_module_args(dict(
|
||||
username_credential='someuser',
|
||||
password='password',
|
||||
server='localhost',
|
||||
user='admin',
|
||||
shell='bash'
|
||||
shell='bash',
|
||||
provider=dict(
|
||||
server='localhost',
|
||||
password='password',
|
||||
user='admin'
|
||||
)
|
||||
))
|
||||
|
||||
module = AnsibleModule(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue