Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rahushen authored and trishnaguha committed Oct 6, 2017
1 parent 146f90e commit 0218fdc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/ansible/modules/network/nxos/nxos_vpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def get_vpc(module):
pkl_vrf = None
peer_gw = False

run = get_config(module, flags=['section vpc'])
run = get_config(module, flags=['vpc'])
if run:
vpc_list = run.split('\n')
for each in vpc_list:
Expand Down
9 changes: 5 additions & 4 deletions lib/ansible/modules/network/nxos/nxos_vpc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def get_existing_portchannel_to_vpc_mappings(module):

def peer_link_exists(module):
found = False
run = get_config(module, flags=['section vpc'])
run = get_config(module, flags=['vpc'])

vpc_list = run.split('\n')
for each in vpc_list:
Expand Down Expand Up @@ -262,9 +262,10 @@ def main():
active_peer_link = None

if portchannel not in get_portchannel_list(module):
module.fail_json(msg="The portchannel you are trying to make a"
" VPC or PL is not created yet. "
"Create it first!")
if not portchannel.isdigit() or int(portchannel) not in get_portchannel_list(module):
module.fail_json(msg="The portchannel you are trying to make a"
" VPC or PL is not created yet. "
"Create it first!")
if vpc:
mapping = get_existing_portchannel_to_vpc_mappings(module)

Expand Down

0 comments on commit 0218fdc

Please sign in to comment.