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

11 Commits

Author SHA1 Message Date
Jonathan Toppins
ef7b7c04b4 ifupdown2: fixup maintainer scripts to not crash on files not existing
Ticket: CM-5735
Reviewed By: no one
Testing Done: lots of repo upgrade testing by John B.

This partially reverts commit 8959e8e4ec93487228733b17ef2b220ed47c1260 ("Fix
bash completion for sudo users (mostly cosmetic)") in the sections where
the Debian maintainer scripts were modified.

In addition fixed up the Debian maintainer scripts to prevent a
potential upgrade failure, discussion follows:

The Cause For the upgrade Failure
=================================

Commit 8959e8e4ec93487228733b17ef2b220ed47c1260 introduced changes to
ifupdown2's package maintainer scripts to override some files provided
by the bridge-utils and udev packages as they conflict with ifupdown2.

The change to ifupdown2's postrm script is currently causing the script
to exit with a failure code if the following files do not exist on the
box:
/etc/udev/rules.d/80-networking.rules
/etc/udev/rules.d/60-bridge-network-interface.rules

The reason for this is in how the script is written.

Since the postrm script is configured to exit on the first command
failure, the "set -e" on line 3, the commands on lines 20 and 22 will
fail if the files being looked for do not exist, causing the script to
exit with a non-zero exit code. Causing apt to fail the upgrade.

.postrm script excerpt
----------
20 udevlink=$(readlink /etc/udev/rules.d/80-networking.rules 2>/dev/null)
21 [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/80-networking.rules
22 udevlink=$(readlink /etc/udev/rules.d/60-bridge-network-interface.rules 2>/dev/null)
23 [ -n "$udevlink" -a "$udevlink" == "/dev/null" ] && rm -f /etc/udev/rules.d/60-bridge-network-interface.rules
----------

Solution
--------

The solution requires having the newer version of the ifupdown2 package
provide a preinst script that gets run before the older package's postrm
script is run[1,2]. This gives us the opportunity to quietly fix the
problem. We also fix the postrm script in newer versions of the package
so it cannot bomb out in this way.

Finally, removed what appears to be a poor merge from commit
5f5d84e3261bf70dd3541666a3d3a7f817727ce6.

Fixes: 8959e8e4ec93487228733b17ef2b220ed47c1260
(cherry picked from commit 0eab79eb5aed4cdf0674e3f0ddad3631dd457bdc)
2015-04-20 15:11:11 -07:00
Roopa Prabhu
c9bba7539d Move LINK_MASTER/LINK_SLAVE to a new field link_type (purna hit some
issues with having it in flags) + add check for bond slave being already up

Ticket: CM-4408
Reviewed By:
Testing Done: some bond sanity test
2014-12-08 22:59:41 -08: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
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
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
4c3af47081 Link ifdown manpage
Ticket: CM-1438
Reviewed By:
Testing Done:
2014-04-11 12:34:47 -07: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
roopa
551a3627d4 Some fixes in dependency handling
Ticket: CM-1438
Reviewed By:
Testing Done: tested with configs involving vlan devices and bridges

- fix dependency handling which i had broken recently with my last
  checkin (nat reported this one)
- In inet pluggins, dont issue ip addr get unless required (saw cpu
  spike up because of CM-1889)
- and some other minor changes lying in my tree
2013-11-30 23:52:30 -08:00
roopa
3e8ee54f30 more fixes + cleanup + support for --exclude argument
Ticket: CM-1438
Reviewed By:
Testing Done:
2013-11-13 16:07:15 -08:00
roopa
a6f80f0e0b python-ifupdown initial checkin
Ticket: CM-1438
Reviewed By: TBD
Testing Done:

- Will checkin build files after some more testing and performance
  numbers. It will go into the testing repo for 2.0

- All TODO items are part of the checked in TODO file
2013-11-04 06:06:11 -08:00