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

addons: vrf: fix check in vrf map initialization when no running vrfs present

Ticket: CM-10178
Review: trivial
Testing: tested with failing testcase in the CM

This patch fixes a check in vrf map initialization code which did
not account for running vrfs correctly. This caused the case where
there were no running vrfs but stale map file to fail.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>

addons,ifupdown,sbin: adding ifquery --with-defaults option

Ticket: CM-7840
Reviewed By: Roopa Prabhu
Testing Done: yes, by installing ifupdown .deb file onto dell-s3000-02

This patch adds a new argument '--with-defaults' to 'ifquery'
when 'ifquery --with-defaults' is executed, running states of all interface
attributes are compared against respective configured attributes from
/etc/network/interfaces file, if configured. Otherwise, compared against
default attributes from policy file

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
This commit is contained in:
Roopa Prabhu
2016-04-19 15:25:23 -07:00
committed by Nikhil
parent fdf548b091
commit 669b422add
7 changed files with 77 additions and 43 deletions

View File

@@ -107,6 +107,8 @@ def run_query(args):
qop = 'query-dependency'
elif args.printsavedstate:
qop = 'query-savedstate'
elif args.withdefaults:
qop = 'query-withdefaults'
else:
qop='query'
cachearg=(False if (iflist or args.nocache or
@@ -130,7 +132,8 @@ def run_query(args):
ifupdown_handle.query([qop], args.all, args.list, args.CLASS, iflist,
excludepats=args.excludepats,
printdependency=args.printdependency,
format=args.format, type=args.type)
format=args.format, type=args.type,
withdefaults=args.withdefaults)
except:
raise
@@ -333,6 +336,11 @@ def update_ifquery_argparser(argparser):
argparser.add_argument('-s', '--syntax-help', action='store_true',
dest='syntaxhelp',
help='print supported interface config syntax')
argparser.add_argument('--with-defaults', action='store_true',
dest='withdefaults',
help='check policy default file contents, ' +
'for unconfigured attributes, against ' +
'running state of an interface')
def update_ifreload_argparser(argparser):
""" parser for ifreload """