Changing order of load and loadfp (#34793)

* Changing order of load and loadfp

* Removing exception as per Ganesh Review comments
This commit is contained in:
Anil Kumar Muraleedharan 2018-01-31 14:04:43 +05:30 committed by Ganesh Nalawade
parent 2c482847ce
commit 4e7e7042cc

View file

@ -183,10 +183,7 @@ def get_running_config(module):
def get_candidate(module):
candidate = NetworkConfig(indent=1)
if module.params['src']:
try:
candidate.loadfp(module.params['src'])
except IOError:
candidate.load(module.params['src'])
candidate.load(module.params['src'])
elif module.params['lines']:
parents = module.params['parents'] or list()
candidate.add(module.params['lines'], parents=parents)