mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix get existing vpc issue (#41429)
This commit is contained in:
parent
e9214725fb
commit
00ce205535
1 changed files with 9 additions and 1 deletions
|
@ -190,7 +190,15 @@ def get_auto_recovery_default(module):
|
||||||
|
|
||||||
def get_vpc(module):
|
def get_vpc(module):
|
||||||
body = run_commands(module, ['show vpc | json'])[0]
|
body = run_commands(module, ['show vpc | json'])[0]
|
||||||
|
if body:
|
||||||
domain = str(body['vpc-domain-id'])
|
domain = str(body['vpc-domain-id'])
|
||||||
|
else:
|
||||||
|
body = run_commands(module, ['show run vpc | inc domain'])[0]
|
||||||
|
if body:
|
||||||
|
domain = body.split()[2]
|
||||||
|
else:
|
||||||
|
domain = 'not configured'
|
||||||
|
|
||||||
vpc = {}
|
vpc = {}
|
||||||
if domain != 'not configured':
|
if domain != 'not configured':
|
||||||
run = get_config(module, flags=['vpc'])
|
run = get_config(module, flags=['vpc'])
|
||||||
|
|
Loading…
Reference in a new issue