Fix os_network's create_network() call for older shade versions (#5058)
A value for the project_id parameter to shade's create_network() call was always being sent, even if no value for 'project' was supplied. This was breaking folks with older versions of shade (< 1.6). Fixes PR https://github.com/ansible/ansible-modules-core/issues/3567
This commit is contained in:
parent
25d829c8f2
commit
d0f7af4b09
1 changed files with 6 additions and 2 deletions
|
@ -222,8 +222,12 @@ def main():
|
||||||
if provider and StrictVersion(shade.__version__) < StrictVersion('1.5.0'):
|
if provider and StrictVersion(shade.__version__) < StrictVersion('1.5.0'):
|
||||||
module.fail_json(msg="Shade >= 1.5.0 required to use provider options")
|
module.fail_json(msg="Shade >= 1.5.0 required to use provider options")
|
||||||
|
|
||||||
net = cloud.create_network(name, shared, admin_state_up,
|
if project_id is not None:
|
||||||
external, provider, project_id)
|
net = cloud.create_network(name, shared, admin_state_up,
|
||||||
|
external, provider, project_id)
|
||||||
|
else:
|
||||||
|
net = cloud.create_network(name, shared, admin_state_up,
|
||||||
|
external, provider)
|
||||||
changed = True
|
changed = True
|
||||||
else:
|
else:
|
||||||
changed = False
|
changed = False
|
||||||
|
|
Loading…
Reference in a new issue