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

8 Commits

Author SHA1 Message Date
Roopa Prabhu
5dfc8d7422 Revert "addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts"
This reverts commit cfc51ed18be9aee902cbc89a57350d9e99a1950d.

this commit seems to have broken usercmds. reverting it until it is
fixed.

Closes: CM-11856
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-07-17 22:04:01 -07:00
Julien Fortin
cfc51ed18b addons: usercmds: adding environment variables passed by the ifupdown2 to user scripts
Ticket: None
Reviewed By: Roopa
Testing Done: with a dummy script I printed the value passed by ifupdown
After the changes I did the same with ifupdown2 and checksd if the values
matched correctly.

This issue was reported on the github repository.

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
2016-07-15 17:00:09 +01:00
Daniel Walton
c6370b563b Add validvals to addons, to be used by iface/ifedit wrapper
Ticket: CM-8669
Reviewed By: Julien
Testing Done:

<DETAILED DESCRIPTION (REPLACE)>
2016-06-16 03:37:35 +01:00
Julien Fortin
a193d8d1c0 performance fix: better handling fd to allow subprocess.close_fds=False and code re-organisation
Ticket: None
Reviewed By: CCR-4692
Testing Done: smoke + scale tests

If called with close_fds=True the subprocess module will try to close every fd
from 3 to MAXFD before executing the specified command. This is done in Python
not even with a C-implementation which truly affecting performances.

This patch aims to better handle the file descriptor used by ifupdown2. Either
by closing them after use or by setting the close-on-exec flag for the file
descriptor, which causes the file descriptor to be automatically
(and atomically) closed when any of the exec-family functions succeed.

With the actual patch all tests are passing, I can't think of any future issue
but if any a possible future modification might be to use the parameter
'preexec_fn', which allows us to set function which will be executed in the
child process before executing the command line. We can always manually close
any remaining open file descriptors with something like:

>>> os.listdir('/proc/self/fd/')
['0', '1', '2', ‘3’, etc..]
>>> for fd in os.listdir('/proc/self/fd/')
>>>    if int(fd) > 2:
>>>    	  os.close(fd)

This patch is also totally re-organising the use of subprocesses. By removing
all subprocess code redundancy.
2016-06-16 03:37:33 +01:00
Roopa Prabhu
fc5e1735c0 ifupdown: add new ifupdownflags class to carry ifupdown flags
Ticket: cleanup
Reviewed By:
Testing Done: Tested ifupdown sanity

This gets rid of some ugly previous flag handling which was
passed through modules. This creates a global instance of
flags that all addon modules and helper modules can use.

Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
2016-04-14 22:30:53 -07:00
Julien Fortin
a4a53f4b45 fixing: ifupdown2 (subprocesses) lives on after control-c + Parsing cmd string with shlex.split instead of string.split
Ticket: CM-9905
Reviewed By: CCR-4363
Testing Done: ^C ifupdown2 while ifreload-ing interfaces test files (~500ifaces) + smoke tests
2016-04-10 18:55:56 +02:00
Roopa Prabhu
84ca006f82 First phase checkin for new format for vlan aware bridge
Ticket: CM-3346
Reviewed By:
Testing Done: Sanity test + test new bridge format

There are a bunch of open issues with `vlan` interface handling.
Below is the format.

auto swp1
iface swp1
    bridge-access 300
    mstpctl-pathcost 0
    mstpctl-adminedge yes
    mstpctl-autoedge yes
    mstpctl-p2p yes
    mstpctl-bpduguard yes
    mstpctl-treeprio 64
    mstpctl-network yes
    mstpctl-bpdufilter yes

auto swp2
iface swp2
    bridge-vids 301
    bridge-pvid 302
    bridge-pathcost 10
    bridge-priority 10
    bridge-multicast-router 0
    bridge-multicast-fast-leave 1

auto br0
iface br0
    bridge-vlan-aware yes
    bridge-stp on
    bridge-ports swp1 swp2
    bridge-vids 2001

auto br0.2001
iface br0.2001
    address 10.0.14.2
    hwaddress 00:03:00:00:00:12
    address-virtual 00:00:5e:00:01:01 11.0.4.1/24

auto br0.2001
vlan br0.2001
    bridge-igmp-querier-src 172.16.101.1
2014-10-24 10:11:07 -07:00
Roopa Prabhu
15ef32ea14 Move ifupdown2addons into ifupdown2 pacakge
Ticket: CM-3864
Reviewed By:
Testing Done: Tested build and install

open item:
- cleanup stale ifupdown2-addons package files
2014-10-09 16:02:46 -07:00