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

100 Commits

Author SHA1 Message Date
Roopa Prabhu
c25e5b6521 Add a new ifupdown2 example to cover bridge igmp and mstp attributes
Ticket: CM-1438
Reviewed By: TBD
Testing Done: Tested the example file with ifupdown2
2014-07-16 14:07:41 -07:00
Roopa Prabhu
ca10586116 Bump kernel ethtool get/set wait to 20 + ifupdown2 convert ethtool
errors to warns

Ticket: CM-3159
Reviewed By: briefly ran this by jtoppins and andy (sfeldma is on
vacation this week).
Testing Done: tested ifupdown2 with ethtool config during boot (sam will
also be adding the testcase mentioned in the bug to ifupdown2 smoke)

The kernel timeout increase helps right now.
we should revisit this again in 2.3 to close all corner cases.

ifupdown2 will now warn on ethtool errors and will also return
non-zero exit status
2014-07-16 14:07:31 -07:00
Roopa Prabhu
fffdae9c21 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
2014-07-16 14:07:22 -07:00
Roopa Prabhu
699c1cffee Fix error flag for cases where errors are ignored (part of commit
3afb698d60a7ec0bb3029efccc82c0bd1aa49197)

Ticket: CM-2960
Reviewed By:
Testing Done: ifupdown2 sanity + precommit
2014-07-16 14:07:13 -07:00
Roopa Prabhu
5973036bba exit with non-zero return code if any of the ifaces have errors
Ticket: CM-2960
Reviewed By:
Testing Done: ifupdown2 sanity + error cases + precommit

uses a class variable to store return value
2014-07-16 14:03:45 -07:00
Roopa Prabhu
f102ef630d Fix splits everywhere to include space and tabs. Use regex split
Ticket: CM-3121
Reviewed By:
Testing Done: Ran precommit

Conflicts:
	packages/ifupdown2-addons/pkg/modulebase.py
2014-07-16 13:51:00 -07:00
Roopa Prabhu
5ee3e1a854 Fix handling of interfaces with --allow CLASS
Ticket: CM-3105
Reviewed By:
Testing Done: precommit and some interface class tests

- the patch mostly involves code reorg
2014-07-16 12:03:03 -07:00
Roopa Prabhu
ba7b1d6084 Fix scheduler for --allow <classes> option
Ticket:
Reviewed By: nobody
Testing Done: Tested --allow <classes>
2014-07-16 12:02:55 -07:00
Roopa Prabhu
c007122552 Fix whitespace issue + uninitialized variable issue
Ticket: CM-2997
Reviewed By: shm
Testing Done: Ran precommit
2014-07-16 12:02:47 -07:00
Roopa Prabhu
33e106daff Fix upperiface check when ifdown is run with -a
Ticket: CM-3007
Reviewed By: shm + patch was pasted in the bug for review
Testing Done: ran precommit + maliks test + malik ran his test on his
box

When -a is specified ifupdown2 works on all interfaces and since the the
upperiface check is a bit expensive i had a "skip" on that.
And so far all the user commands i have seen only work on the $IFACE and
not its dependents. So, never hit this case.
2014-07-16 12:02:38 -07:00
Roopa Prabhu
1b0b81a23f prefix ethtool attributes with "link-" to be compatible with
native ifupdown + documentation fixes

Ticket: CM-3000
Reviewed By: trivial + doc related
Testing Done: Ran precommit
2014-07-16 12:02:31 -07:00
Roopa Prabhu
068a729037 Add close_fds=True in ifupdownbase class
Ticket: CM-2899
Reviewed By:
Testing Done: Tested ifupdown sanity

Just closing all the places where we could leak fds.
2014-07-16 12:01:59 -07:00
Roopa Prabhu
51a8099130 Fix typo
Ticket: CM-2911
Reviewed By: pbendale
Testing Done:
2014-06-12 06:05:40 -07:00
Roopa Prabhu
522bf8e68b Fix bash completion for sudo users (mostly cosmetic) + man page and
example fixes

Ticket: CM-2911
Reviewed By: CCR-1637
Testing Done: tested ifupdown2 sanity and bash completion

The python argcomplete module that i use for ifupdown2 has a limitation
that it does not work with sudo when used in the global mode. But there is
a workaround for it online (long story short...instead of enabling the global
argparse complete ...the author recommends registering argparse complete bash
completion individually for your script). This patch does just that.

This patch also moves the udev overrides to their respective packages.
Two of them are owned by ifupdown2.

Conflicts:
	rootconf/default/home/cumulus/sysroot-complete
2014-06-10 19:31:50 -07:00
Roopa Prabhu
69cf2f0de7 Use closefds=True and shell=True when executing usercmds
Ticket: CM-1438
Reviewed By: reported by purna
Testing Done: Tested with purna's l2 l3 lag test

problem fixed by this patch:
In some cases the child processes executing user cmds seem to hold on to
the lock file fd for a lil longer, preventing another instance of
ifupdown from running immediately after. Seen with two immediate
instances of service networking restarts from scripts when the
interfaces file has many user cmds.
2014-06-01 11:12:06 -07:00
Roopa Prabhu
44a6ca06b7 Fix query-check object for interfaces with multiple iface sections
Ticket: CM-1438
Reviewed By:
Testing Done: ifupdown2 sanity
2014-05-31 21:52:16 -07:00
Roopa Prabhu
dbba401f4d remove native ifupdown support from bridge-utils, vlan, ifenslave and
mstpctl + some ifupdown2 documentation cleanup

Ticket: CM-1438
Reviewed By:
Testing Done: ifupdown2 sanity testing

Conflicts:
	patches/bridge-utils/series
2014-05-29 15:45:55 -07:00
roopa
923290bd42 Fix bug during handling multiple iface sections for same interface
Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifupdown2 sanity + multiple iface sections for an
interface

- This patch fixes a few shortcomings in the multiple iface sections
for same interface (partly because i was only covering
backward compatibility cases earlier)
- Since this is a very common configuration pattern, this patch cleans
  it up
- also restructures some code
- main change is:
    before:
        for iface in ifaces:
            for op in ops:
                run op on iface

    after:
        for op in ops:
            for iface in ifaces:
                run op on iface
2014-05-26 09:03:29 -07:00
Nolan Leake
4931e447fe Update/add copyright files for Cumulus .debs. 2014-05-23 15:32:53 -07:00
roopa
93e8319a1f Move interfaces example generation script to under
/usr/share/python-ifupdown2

Ticket: CM-2643
Reviewed By:
Testing Done: Tested ifupdown2 sanity
2014-05-21 12:39:30 -07:00
roopa
883f7f83f2 Add examples and script to generate sample interfaces file
Ticket: CM-2643
Reviewed By:
Testing Done: Tested build/install

This also pulls in python-gvgen package from wheezy sid into our
upstream dir. Previously i had packaged the gvgen module directly
into the ifupdown package
2014-05-19 07:00:12 -07:00
roopa
86fc62e20c make a few things configurable (check output err/success string +
warnings on ifupdown)

Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifupdown2 sanity

Some of the above mentioned configurable items can be specified in
ifupdown2.conf
2014-05-09 09:10:49 -07:00
roopa
615234a10d make a copy of the indegrees dict in the graph module
Ticket: CM-2731
Reviewed By:
Testing Done: Tested ifupdown sanity

The graph module modifies the indegrees array and so introduce a copy
of the dict before modifying it.
2014-05-07 23:20:04 -07:00
roopa
f90dd03886 Fix stray call to dict which was converting my ordered dict to an unordered dict
Ticket: CM-2731
Reviewed By:
Testing Done:

This was resulting in eth0 missing its first spot during interface
bringup
2014-05-07 22:48:29 -07:00
roopa
31c5878750 Change mstpctl show output parsing code (Use mstpctl show using
param-id). Its less prone to problems.

Ticket: CM-1438
Reviewed By:
Testing Done:

- Also add bpdufilter support
- This also gets rid of caching for mstpctl output
2014-05-05 13:39:00 -07:00
roopa
65c485175b include only interfaces with no config in the upperiface check
Ticket: CM-1438
Reviewed By:
Testing Done: sanity and ifdown on bridges with vlans that dont have
user config
2014-05-02 08:10:59 -07:00
roopa
99b212b016 Bring back upperiface check during down (One of my recent checkins had
removed it)

Ticket: CM-2671
Reviewed By:
Testing Done: Tested test case in CM-2671 and ifupdown2 sanity
2014-04-29 21:45:57 -07:00
roopa
3dcc1d0eeb support json input + multiple instance running check
Ticket: CM-1438
Reviewed By:
Testing Done: Tested sanity and interfaces file in json format
2014-04-28 22:33:33 -07:00
roopa
d40e96ee4e man page cleanup + cleanup + minor fixes
Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifupdown sanity
2014-04-25 16:09:14 -07:00
roopa
07a8db37f9 Fix ifupdown2 dpkg-configure error during build
Ticket:
Reviewed By: sergey
Testing Done:

dpkg-configure during build seems to be picking up python2.6 and
python2.6 was complaining about the syntax. Fixed with syntax
compatible with python2.6
2014-04-23 14:36:47 -07:00
roopa
c778afebc3 Cosmetic - register level names
Ticket:
Reviewed By:
Testing Done: Tested sanity
2014-04-22 22:27:59 -07:00
roopa
d913472d5a Check addr_family and addr_method validity
Ticket: CM-2302
Reviewed By: trivial
Testing Done: Tested addr family and addr method syntax check
2014-04-22 22:25:52 -07:00
roopa
2cd06f78fa Use json.dumps() with 'separator attribute' to separate json object list
dumps + some cosmetic fixes + refactoring

Ticket: CM-2642
Reviewed By: sergey
Testing Done: Tested json output + sanity test
2014-04-22 21:55:11 -07:00
roopa
ee20f46e8d Fix build error
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-04-18 21:05:03 -07:00
roopa
14dc390d71 Fixes to some corner cases + support for some missing 'options and
attributes' for backward compatibility

Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifupdown sanity and new functionality

support for:
- -i <interface file>
- template lookup path and move all template handling to a separate
  module template.py
- new ifupdown2 config file /etc/network/ifupdown2/ifupdown2.conf
- bridge_waitport and bridge_maxwait
- moved addons.conf to /var/lib/ifupdownaddons/
2014-04-18 14:09:20 -07:00
roopa
03d5166bff Fix PATH env for boot environment
Ticket: CM-2602
Reviewed By: trivial
Testing Done: Tested with pre-up script during boot
2014-04-14 22:56:51 -07:00
roopa
4c3af47081 Link ifdown manpage
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-04-11 12:34:47 -07:00
roopa
bbc7c379dc Fix manpage formatting
Ticket: CM-1438
Reviewed By:
Testing Done: Checked man page
2014-04-11 12:29:31 -07:00
roopa
7949b8a51a Fix a few syntax checker bugs
Ticket: CM-2302
Reviewed By:
Testing Done: Tested ifupdown syntax checker + sanity

Also includes fixes to some of the sytax checker problems mentioned in
CM-2509
2014-04-08 14:50:15 -07:00
roopa
7a51240ec2 Make ifupdown2 insensitive to '-' and '_' in interface attribute names.
Ticket: CM-2501
Reviewed By:
Testing Done: Tested ifupdown sanity
2014-04-07 14:38:06 -07:00
roopa
525f0a30ef cleanup + fix some reload caching issues
Ticket: CM-2508
Reviewed By:
Testing Done: ifreload and ifupdown sanity testing
2014-04-04 15:00:59 -07:00
roopa
7538dc77f5 Fix statemanager update flag condition + some debug print cleanup
Ticket: CM-1438
Reviewed By:
Testing Done: ifupdown2 sanity
2014-04-01 15:21:51 -07:00
roopa
cb7cc59218 Cleanup saved state for down objects on ifdown
Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifup/ifdown sanity

This was a pending cleanup activity.
2014-03-30 22:38:00 -07:00
roopa
55c86113d3 Check for duplicate interfaces
Ticket: CM-2509
Reviewed By:
Testing Done: Tested interfaces file with duplicate entries

Old ifupdown allowed multiple stanza's for the same interface.
To support older files ifupdown2 will continue to support duplicate interfaces.
However this check will warn on interfaces with same config more than
once. The check is done at a higher level during parsing and hence only
does a string compare of the iface section.
2014-03-30 08:15:06 -07:00
roopa
339026c894 Fix print methods to not follow dependents when -a is set (-a already
covers all dependents)

Ticket: CM-2505
Reviewed By:
Testing Done: Tested ifquery
2014-03-29 14:51:37 -07:00
roopa
9dce35612d warn on template rendering errors and continue + --syntax-check option to ifup +
minor parser cleanups

Ticket: CM-2488
Reviewed By:
Testing Done: Tested ifupdown sanity and also the interfaces file in CM-2488
2014-03-28 06:03:14 -07:00
roopa
08179c9d2e state manager test
Ticket:
Reviewed By:
Testing Done:
2014-03-27 16:53:32 -07:00
roopa
91067b3d23 Remove batch support when deleting addresses. batching code does not
update the cache yet and that can cause problems during add

Ticket: CM-2491
Reviewed By:
Testing Done:

Still working on the cache update support during batching.
2014-03-27 16:36:54 -07:00
roopa
ca3f4fc75a Remove upper device check warnings + implicitly follow upperifaces when
a logical interface comes up

Ticket: CM-2493
Reviewed By:
Testing Done: Tested ifup, ifdown in bond bridge setup

Also, implicitly pick up the upperifaces (even when user has not
specified --with-depends) for logical interfaces.
This is because when a logical interface goes down/deleted, kernel
impilicity deletes its upperifaces. so its better to implicitly bring
up upperifaces.

example

bridge name    bridge id        STP enabled    interfaces
br0        8000.7072cf8c2fca    yes        bond1
                            bond2
br2000        8000.7072cf8c2fca    yes        bond1.2000
                            bond2.2000
br2001        8000.7072cf8c2fca    yes        bond1.2001
                            bond2.2001

bridge name    bridge id        STP enabled    interfaces
br0        8000.000000000000    yes
br2000        8000.000000000000    yes
br2001        8000.000000000000    yes

bridge name    bridge id        STP enabled    interfaces
br0        8000.7072cf8c2fca    yes        bond1
                            bond2
br2000        8000.7072cf8c2fca    yes        bond1.2000
                            bond2.2000
br2001        8000.7072cf8c2fca    yes        bond1.2001
                            bond2.2001
2014-03-27 14:00:00 -07:00
roopa
53b0022499 cleanup + fixes
Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifupdown sanity
2014-03-25 15:21:19 -07:00