mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
ifupdown2 2.0.0 release
This is a major update coming all at once from master-next branch master-next branch was started with --orphan option which is basically a new branch without history. The major changes are: - repackaging - cleanup the directory tree - rewritte setup.py to allow install from deb file or pypi (pip install) - add a Makefile to make things (like building a deb) easier - review all debian files Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
@ -3,10 +3,7 @@
|
||||
import argparse
|
||||
import sys
|
||||
import subprocess
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import os
|
||||
>>>>>>> cumulus/dev
|
||||
|
||||
""" This script prints to stdout /etc/network/interfaces entries for
|
||||
requested interfaces.
|
||||
@ -34,21 +31,6 @@ import os
|
||||
|
||||
"""
|
||||
|
||||
<<<<<<< HEAD
|
||||
def get_swp_interfaces():
|
||||
porttab_path = '/var/lib/cumulus/porttab'
|
||||
ports = []
|
||||
|
||||
ptfile = open(porttab_path, 'r')
|
||||
for line in ptfile.readlines():
|
||||
line = line.strip()
|
||||
if '#' in line:
|
||||
continue
|
||||
try:
|
||||
ports.append(line.split()[0])
|
||||
except ValueError:
|
||||
continue
|
||||
=======
|
||||
def get_pci_interfaces():
|
||||
ports = []
|
||||
FNULL = open(os.devnull, 'w')
|
||||
@ -90,12 +72,11 @@ def get_swp_interfaces():
|
||||
if not ports:
|
||||
print 'Error: No ports found in %s' % porttab_path
|
||||
exit(1)
|
||||
>>>>>>> cumulus/dev
|
||||
return ports
|
||||
|
||||
def print_swp_defaults_header():
|
||||
print '''
|
||||
# ** This file is autogenerated by /usr/share/doc/python-ifupdown2/generate_interfaces.py **
|
||||
# ** This file is autogenerated by /usr/share/doc/ifupdown2/generate_interfaces.py **
|
||||
#
|
||||
# This is /etc/network/interfaces section for all available swp
|
||||
# ports on the system.
|
||||
@ -112,7 +93,7 @@ def print_swp_defaults_header():
|
||||
|
||||
def print_bridge_untagged_defaults_header():
|
||||
print '''
|
||||
# ** This file is autogenerated by /usr/share/doc/python-ifupdown2/generate_interfaces.py **
|
||||
# ** This file is autogenerated by /usr/share/doc/ifupdown2/generate_interfaces.py **
|
||||
#
|
||||
# This is /etc/network/interfaces section for a bridge device with all swp
|
||||
# ports in the system.
|
||||
@ -186,12 +167,6 @@ if args.bridgedefault and args.mergefile:
|
||||
exit(1)
|
||||
|
||||
swp_intfs = get_swp_interfaces()
|
||||
<<<<<<< HEAD
|
||||
if not swp_intfs:
|
||||
print 'error: no ports found'
|
||||
exit(1)
|
||||
=======
|
||||
>>>>>>> cumulus/dev
|
||||
|
||||
if args.swpdefaults:
|
||||
interfaces_print_swp_defaults(swp_intfs)
|
||||
|
Reference in New Issue
Block a user