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

56 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
roopa
fa3da4be43 Only warn on ifdown of an interface who has upperifaces still around +
cleanup

Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifup/ifdown sanity
2014-03-24 06:28:08 -07:00
roopa
62ddec8b52 cleanup (mostly cosmetic)
Ticket: CM-1438
Reviewed By:
Testing Done: sanity test
2014-03-22 22:16:53 -07:00
roopa
c798b0f4aa execute 'up' on upper devices if ifup is called with --with-depends
Ticket: CM-1438
Reviewed By: review pending
Testing Done: Tested ifup/ifdown

Before this patch, `ifup --with-depends <iface>` only brought up
lowerdevices. Because those were enough for iface to function.

And if ifaces above it (upperdevices) needed fixing, user could just
execute `ifup --with-depends <ifaceupper>`.

But in a recent, bond under a bridge bug in 2.0, got me thinking that
its probably better to up the upperdevices which might be impacted as
well. and this patch does just that.

The patch includes changes to make ifupdown generate dependency
information for all interfaces even if the user requested to operate
on a single interface. This is to get a full view of the interfaces file.
This might add some overhead. Should not change anything during boot.
Still looking at ways to optimize.
2014-03-18 16:38:00 -07:00
roopa
dab8d81ec7 Remove dead code
Ticket: CM-1438
Reviewed By: trivial
Testing Done: Tested ifup/ifdown
2014-03-17 06:38:55 -07:00
roopa
21c7daa773 Fix upperiface check to not barf when --force is used
Ticket: CM-2366
Reviewed By: trivial
Testing Done: Tested ifup/ifdown with bonds and bridges

Also refactored some code.
2014-03-06 14:37:28 -08:00
roopa
5c72192578 A few state manager optimizations + and some other fixes
Ticket: CM-1438
Reviewed By:
Testing Done:

This also fixes a bug with address handling:
- If the user changed a primary address, flush all the addresses and
  re-add them. Previously, if user added a new primary address, it would
ust get appended to the end of the address list as a secondary address.
2014-03-06 06:41:28 -08:00
roopa
a690dfae1b ip batch support for mstp bridges + add support for multiple globs in a
single port expression + cleanup

Ticket: CM-1438
Reviewed By:
Testing Done:

This has left some dead code in. cleanup comming in subsequent patches.
ip batch support is not complete. It currently works only for mstpctl
bridges. more coming ..
2014-02-27 22:23:03 -08:00
roopa
20dd6242f6 ifudown --no-scripts support
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-26 08:09:44 -08:00
roopa
31a5f4c364 cleanup state manager + remove some dead code
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-24 11:07:59 -08:00
roopa
e938bfeccd workaround to fix dhcp delay at bootup
Ticket: CM-2317
Reviewed By:
Testing Done:

still investigating the iproute delay.
2014-02-20 13:11:22 -08:00
roopa
6bd7fc7466 Disable exec of legacy /etc/network/<scripts> for now because of the
overhead

Ticket: CM-1438
Reviewed By:
Testing Done:

These are executed with shell=True and python subprocess performance
with shell=True sucks. This seems to have improved in python3. Will try
that out next. And also plan to make this controllable via an option.

This reduces time to ifup by half.
2014-02-20 09:07:55 -08:00
roopa
fe0a57d355 remove dhclient -nw option + cleanup
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-19 21:30:55 -08:00
roopa
69f582783b Fixes for some corner cases + cleanup
Ticket: CM-1438
Reviewed By:
Testing Done:

Also includes fix for CM-2307 and some other fixes for primary/secondary
address handling.
2014-02-18 22:25:48 -08:00
roopa
be0b20f288 Support for manual method + rearrange some code
Ticket: CM-1438
Reviewed By:
Testing Done:

- Moved link config to base ifupdown. I had been debating about this,
  this is need to support manual and also the --no-scripts option.
- helps executing only link up/down operations if needed on an interface
- While at it, i also moved the scheduler methods to be classmethods
  instead of instance methods (which again was a pending cleanup task)
2014-02-17 19:01:37 -08:00
roopa
83c1f241fd minor fixes + cleanup + update manpage
Ticket: CM-1438
Reviewed By:
Testing Done:

- simplified the dot generator
2014-02-15 21:39:13 -08:00
roopa
e37ad4a607 cleanup, documentation and enable ifupdown2 by default
Ticket: CM-1438
Reviewed By:
Testing Done:

There are a few known issues listed in the TODO and KNOWN_ISSUES files
2014-02-14 09:55:19 -08:00
roopa
f802fe3ccb cleanup and some documentation
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-13 21:37:26 -08:00
roopa
f321512771 Fix l3 lag test failure
Ticket: CM-1438
Reviewed By:
Testing Done: l3 lag test with help from purna

- THe down sequence in the new ifupdown was causing switchd some grief
  (wilson is looking at it). readded the topological sort which i had
removed in favor of only walking the tree. With the fix,i dont see the
switchd problem anymore.
- And another down bug was causing the bond to go away prematurely (only
  with the all depends option). Added a upperdevice list to track upperdev references
2014-02-12 22:29:41 -08:00
roopa
757301523b minor ifquery print fixes
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-11 06:00:07 -08:00
roopa
6ef5bfa291 Some compat fixes + some stp precommit test fixes
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-10 14:39:18 -08:00
roopa
d08d5f5478 More fixes and cleanup
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-02-08 09:05:32 -08:00
roopa
37c0543d34 More fixes and changes
Ticket: CM-1438
Reviewed By:
Testing Done: unit tested with all kinds of interfaces

some high level changes
- moved ipv4/ipv6 address handling in a single module. dhcp
into a separate module.
- new link 'up' module
- igmp fixes
- many other fixes
2014-01-30 22:36:41 -08:00
roopa
cca03c30c5 some ifquery fixes + make the default to not follow dependents (
added a --with-depends option)

Ticket: CM-1438
Reviewed By:
Testing Done:

still debating on the default behaviour for following dependents.
for now not following dependents might be better.
When all interfaces are selected, it always follows dependents
2014-01-30 19:53:49 -08:00
roopa
739f665baa A whole lot of fixes and some new code (needs some cleanup which will be
part of subsequent checkins)

Ticket: CM-1438
Reviewed By:
Testing Done: Tested ifup, ifdown and ifquery

Conflicts:
	packages/ifupdown2-addons/addons/ifenslave.py
2014-01-30 19:53:25 -08:00