From bcecc528eefab956643f3ccf1ba0722e2f01722d Mon Sep 17 00:00:00 2001 From: Junaid Ali Date: Mon, 25 Jul 2016 22:01:44 +0500 Subject: [PATCH] Changes: - Removed default value for management interface - Updated get-mgmt method --- config.yaml | 1 - hooks/pg_gw_utils.py | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index f961bb6..fa65925 100644 --- a/config.yaml +++ b/config.yaml @@ -11,7 +11,6 @@ options: description: Public SSH key of PLUMgrid LCM which is running PG-Tools mgmt-interface: type: string - default: 'juju-br0' description: The interface connected to PLUMgrid Managment network. fabric-interfaces: default: 'MANAGEMENT' diff --git a/hooks/pg_gw_utils.py b/hooks/pg_gw_utils.py index 73ae795..ebd5899 100644 --- a/hooks/pg_gw_utils.py +++ b/hooks/pg_gw_utils.py @@ -222,7 +222,9 @@ def get_mgmt_interface(): Returns the managment interface. ''' mgmt_interface = config('mgmt-interface') - if interface_exists(mgmt_interface): + if not mgmt_interface: + return get_iface_from_addr(unit_get('private-address')) + elif interface_exists(mgmt_interface): return mgmt_interface else: log('Provided managment interface %s does not exist'