Updated get_mgmt method

This commit is contained in:
Junaid Ali 2016-07-28 00:03:20 +05:00
parent 04ac6bf354
commit e5938ba7b7
1 changed files with 3 additions and 1 deletions

View File

@ -222,7 +222,9 @@ def get_mgmt_interface():
Returns the managment interface.
'''
mgmt_interface = config('mgmt-interface')
if mgmt_interface and interface_exists(mgmt_interface):
if not mgmt_interface:
return get_iface_from_addr(unit_get('private-address'))
elif mgmt_interface and interface_exists(mgmt_interface):
return mgmt_interface
else:
log('Provided managment interface %s does not exist'