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

5 Commits

Author SHA1 Message Date
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
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
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
724a5011b9 Remove stale debug
Ticket:
Reviewed By:
Testing Done:
2014-12-09 14:26:11 -08:00
830c91d7e6 First cut ifupdown2 module for vrrpd
Ticket: CM-3454
Reviewed By:
Testing Done: basic testing with vrrpd

There is no check support yet and an open issue
with checking existing ifplugd processes
2014-11-11 21:47:29 -08:00