From 22498b571c01c550255b23bf1203a43faada9f20 Mon Sep 17 00:00:00 2001 From: Roopa Prabhu Date: Mon, 7 Jul 2014 11:30:52 -0700 Subject: [PATCH] Fix use of args.CLASS with ifreload (reload does not support CLASS yet). Ticket: CM-3176 Reviewed By: trivial Testing Done: Tested ifreload with the testcase in the bug This broke when i recently fixed --allow-classes support for ifup/ifdown --- sbin/ifupdown | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sbin/ifupdown b/sbin/ifupdown index 09038ec..91e2525 100755 --- a/sbin/ifupdown +++ b/sbin/ifupdown @@ -338,13 +338,18 @@ def validate_args(op, args): # return True if op == 'query' and args.syntaxhelp: return True - if not args.iflist and not args.all and not args.CLASS: + if op == 'reload': + if not args.all: + print '\'-a\' option is required' + return False + elif (not args.iflist and + not args.all and not args.CLASS): print '\'-a\' option or interface list are required' return False if args.iflist and args.all: print '\'-a\' option and interface list are mutually exclusive' return False - if args.CLASS and (args.all or args.iflist): + if op != 'reload' and args.CLASS and (args.all or args.iflist): print ('\'--allow\' option is mutually exclusive ' + 'with interface list and \'-a\'') return False