os_subnet: allow using non-default subnet pool (#52608)
(cherry picked from commit 17f2b5f73e
)
This commit is contained in:
parent
04ca93a5c0
commit
a307a6a89a
2 changed files with 9 additions and 3 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- >
|
||||||
|
os_subnet - it is valid to specify an explicit ``subnetpool_id`` rather than
|
||||||
|
``use_default_subnetpool`` or ``cidr``
|
|
@ -272,9 +272,10 @@ def main():
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
if not module.params['network_name']:
|
if not module.params['network_name']:
|
||||||
module.fail_json(msg='network_name required with present state')
|
module.fail_json(msg='network_name required with present state')
|
||||||
if not module.params['cidr'] and not use_default_subnetpool:
|
if (not module.params['cidr'] and not use_default_subnetpool and
|
||||||
module.fail_json(msg='cidr or use_default_subnetpool required '
|
not extra_specs.get('subnetpool_id', False)):
|
||||||
'with present state')
|
module.fail_json(msg='cidr or use_default_subnetpool or '
|
||||||
|
'subnetpool_id required with present state')
|
||||||
|
|
||||||
if pool_start and pool_end:
|
if pool_start and pool_end:
|
||||||
pool = [dict(start=pool_start, end=pool_end)]
|
pool = [dict(start=pool_start, end=pool_end)]
|
||||||
|
|
Loading…
Reference in a new issue