1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

Move link_master_slave flag overrides to /sbin/ifupdown + log a msg to

indicate link_master_slave flag status

Ticket:
Reviewed By:
Testing Done: ifupdown2 sanity tests with link_master_slave feature on/off
This commit is contained in:
Roopa Prabhu
2014-12-29 22:07:49 -08:00
parent fff589ea4c
commit cebe79c93a
2 changed files with 23 additions and 14 deletions

View File

@@ -406,7 +406,7 @@ def validate_args(op, args):
return False
return True
def read_config():
def read_config(args):
global configmap_g
config = open(configfile, 'r').read()
@@ -424,6 +424,18 @@ def read_config():
# module can catch it appropriately
configmap_g['no_repeats'] = {'bridge-vlan-aware' : 'yes'}
configval = configmap_g.get('link_master_slave', '0')
if configval == '1':
# link_master_slave is only valid when all is set
if hasattr(args, 'all') and not args.all:
configmap_g['link_master_slave'] = '0'
configval = configmap_g.get('delay_admin_state_change', '0')
if configval == '1':
# reset link_master_slave if delay_admin_state_change is on
configmap_g['link_master_slave'] = '0'
def main(argv):
""" main function """
args = None
@@ -454,7 +466,7 @@ def main(argv):
print 'Another instance of this program is already running.'
exit(0)
read_config()
read_config(args)
init(args)
handlers.get(op)(args)
except Exception, e: