mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
os_user: fix module undefined
module variable in the function is undefined. Pass it. fix "NameError: name 'module' is not defined"
This commit is contained in:
parent
a86878c425
commit
a5c70dc672
1 changed files with 2 additions and 2 deletions
|
@ -177,7 +177,7 @@ def _get_domain_id(cloud, domain):
|
||||||
|
|
||||||
return domain_id
|
return domain_id
|
||||||
|
|
||||||
def _get_default_project_id(cloud, default_project):
|
def _get_default_project_id(cloud, default_project, module):
|
||||||
project = cloud.get_project(default_project)
|
project = cloud.get_project(default_project)
|
||||||
if not project:
|
if not project:
|
||||||
module.fail_json(msg='Default project %s is not valid' % default_project)
|
module.fail_json(msg='Default project %s is not valid' % default_project)
|
||||||
|
@ -232,7 +232,7 @@ def main():
|
||||||
module.fail_json(msg=msg)
|
module.fail_json(msg=msg)
|
||||||
default_project_id = None
|
default_project_id = None
|
||||||
if default_project:
|
if default_project:
|
||||||
default_project_id = _get_default_project_id(cloud, default_project)
|
default_project_id = _get_default_project_id(cloud, default_project, module)
|
||||||
|
|
||||||
if user is None:
|
if user is None:
|
||||||
user = cloud.create_user(
|
user = cloud.create_user(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue