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

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

This patch also: (1) fixes ifquery check failure for bridge-* stp attributes.
(2) removes vrf-default-route and vrf-cgroup attributes from ifupdown2 policy
and just have the vrf-helper attribute

Signed-off-by: Nikhil <nikhil@cumulusnetworks.com>
This commit is contained in:
Nikhil
2016-04-20 03:02:26 -07:00
parent 669b422add
commit 6e16e5ae90
9 changed files with 84 additions and 85 deletions

View File

@@ -107,8 +107,6 @@ 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
@@ -125,15 +123,15 @@ def run_query(args):
cache=cachearg,
interfacesfile=interfacesfilename,
interfacesfileiobuf=interfacesfileiobuf,
interfacesfileformat=args.interfacesfileformat)
interfacesfileformat=args.interfacesfileformat,
withdefaults=args.withdefaults)
# list implies all auto interfaces (this is how ifupdown behaves)
if args.list:
args.all = True
ifupdown_handle.query([qop], args.all, args.list, args.CLASS, iflist,
excludepats=args.excludepats,
printdependency=args.printdependency,
format=args.format, type=args.type,
withdefaults=args.withdefaults)
format=args.format, type=args.type)
except:
raise