summaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_eni.py
AgeCommit message (Collapse)AuthorFilesLines
2017-05-30Continue bringing up interfaces even if one failsBen Nemec1-0/+8
Currently os-net-config exits immediately if an interface fails to come up. This causes problems when we call it with a failsafe configuration because it can result in working interfaces not being configured if there are also non-functional interfaces, which can leave a system unreachable over the network even though it may have a working connection. This change stores errors and handles them after all interfaces have been processed to allow os-net-config to do what it can even with an invalid configuration. If any failures are detected it will still cause os-net-config to report failure at the end. Change-Id: I3bc75e217d0b7c5ae62900f4253ad57ee3720685 Closes-Bug: 1692725
2017-01-05Make os-net-config pass tox py3 testsFrank A. Zdarsky1-2/+2
This patch improves Python 3 compatibility by replacing .iteritems() with .items() for iterating over dicts and fixing two tests to use portable string comparison. Change-Id: I8e1acafe372f1696823561d6aa8aae5437d34025 Closes-Bug: #1654187
2016-11-18Add support for enabling hotplug on interfacesBrent Eagles1-1/+4
This patch adds support for enabling hotplugging on interfaces (disabled by default). This is useful for configuring SR-IOV root devices so that they "return" to the system when no longer used by a VM. Note: also updates an invalid value in the interface and ib_interface sample files. Partial-Bug: #1639901 Change-Id: Idfc17d6f20bb306271838895bc53f4b109dd664d
2016-11-15Merge "Raise NotImplementedError instead of NotImplemented"Jenkins1-1/+1
2016-10-19Add route_options parameterMatthew Flusche1-4/+7
route_options will append additional options to route definitions. Change-Id: I2b70efdd9c6df7ea252576e245fbc0e9c46ea4bd
2016-09-02Raise NotImplementedError instead of NotImplementedJi-Wei1-1/+1
NotImplementedError is the name of the exception (https://docs.python.org/2/library/exceptions.html). NotImplemented is the name of a constant (https://docs.python.org/2/library/constants.html). >>> raise NotImplemented() Traceback (most recent call last): File "<pyshell#31>", line 1, in <module> raise NotImplemented() TypeError: 'NotImplementedType' object is not callable >>> raise NotImplementedError() Traceback (most recent call last): File "<pyshell#32>", line 1, in <module> raise NotImplementedError() NotImplementedError This patch fix it. Change-Id: I8b8b47de26b9bf688d9d27a4daa6d9910994ac4a Closes-Bug: #1339855
2016-02-15Allow setting MTU to 1500Ian Pilcher1-1/+1
There are times when it is desirable to set the MTU of an "interface" to 1500 -- when the external network and the storage network are different VLANs on the same physical interface, for example. Change-Id: Ic5ea6ad05118fd57c26c898a460c19969de4109d Closes-Bug: #1539821
2015-08-17Support multiple addresses assignment with eniTomoki Sekiyama1-4/+9
Currently only the first IPv4/v6 address is assigned to a NIC even if multiple addresses are specified in config file. With this change, eni implementation can configure multiple IPv4/v6 addresses for a NIC. Also this fixes IPv6 netmask format, which currently causes an error on ifup. Change-Id: I0a38d376bece8af297bddede594962fd3a193d09
2015-08-02Allow to specify the root directory of the filesystemFrederic Lepied1-8/+8
Change-Id: Ice1b8d17804cf7a0aafd308945a5e960fe927bbc
2015-03-05Add a --no-activate option to disable device up/down actionsSteven Hardy1-9/+16
Allows you to only install the config, but not take interfaces down/up. Useful if you wish to defer activation of a new config until a later time (e.g reboot). Change-Id: I42f3195e1d3d5d3b9d1c9dbb1f7cf1364503cbd3
2015-02-24Refactor ifup/ifdown into base-classSteven Hardy1-10/+4
Refactor some common code so the base-class handles the ifup/down Change-Id: Id1fee1d2d5c9315717611b7bf18f058c49fe3622
2015-02-24Refactor noop to enable logging of disabled operationsSteven Hardy1-16/+13
Currently we only output the config file contents in noop mode, but it's very useful to see what would be done in terms of taking interfaces up and down, and especially what will be removed when --cleanup mode is specified So this refactors the operations skipped by noop into the base-class so we can conveniently log what they would do when --noop is selected. Change-Id: Ia9cfa9a05b2df02c165a2ff992765ab63e55ae6b
2015-02-24Remove deprecated references to oslo-incubatorSteven Hardy1-1/+1
Purge references to modules which have been deprecated by various oslo libraries. Requires changes to use oslo.utils and oslo.concurrency, which are added to the requirements, syncing with the latest in global requirements so we can also move to the un-namespaced oslo package names. Change-Id: Idacb71b7871330e3b3fabf4a926a5b8987614c4d
2015-02-24Move noop flag to provider base-classSteven Hardy1-4/+5
Moving this flag makes it easier to implement additional functions which work differently depending on noop mode being set, vs passing it into every function like apply() Change-Id: I796792aece3e40322523e910a3b87f7ab9a451dd
2015-02-24Add a persist_mapping option to the mapping fileSteven Hardy1-0/+3
This adds the option to permanently rewrite the configuration so the aliases are used instead of the system name. This is useful where you have a variety of hardware and you want to have consistent device naming accross all platforms - this allows you to essentially rename the interfaces permanently so they match the abstracted nicN names. Note, this needs to be run with --cleanup or the old (now conflicting) configs will still be in place, and it may require a reboot before the changes are fully applied. Change-Id: I5af146e764b72c4beaa41c549fabff0af8802152
2014-12-16Merge "If setting a default route, use default netmask"Jenkins1-2/+5
2014-12-12Correct the ENI provider name log statementDan Prince1-1/+1
Change-Id: I88118836605fade6bc7978b2d65ed51cef0cdc80
2014-11-24If setting a default route, use default netmaskJames Polley1-2/+5
Without this change, when configuring a default route, it's neccessary to explicitly provide an ip_netmask of 0.0.0.0/0 - otherwise line 177 errors because there's no route.ip_netmask. With this change, it's still possible to provide an ip_netmask for a default route (even though that makes no sense), but if none is provided The Right Thing is done. Change-Id: Idac59e571a72cc8d5693f811ec0121273b891d0f
2014-08-22Fix a few pep8 issues...Dan Prince1-2/+2
2014-08-22Add support for ovs_extra.Dan Prince1-3/+8
Adds support for ovs_extra to the OVS Bridge and OVS bond objects.
2014-08-21A vlan on an OVS bridge doesn't require a deviceDan Prince1-2/+3
Updates the object model so that a VLAN on top of a bridge (an OVS int port) doesn't require a physical device to be set in the object model.
2014-08-21Correct the noop format for the eni providerDan Prince1-1/+1
Corrects the eni provider so that it returns the correct format in noop mode.
2014-08-14Docstring updates to NetConfig objects.Dan Prince1-0/+12
2014-08-14Add --cleanup, and impl for ifcfgDan Prince1-1/+1
Adds a new cleanup option which can be used to ifdown and remove interfaces that exists but aren't specified in the object model (or JSON).
2014-08-14Use underscores for provider function names.Dan Prince1-13/+13
2014-08-12Set the MAC to the primary interfaceDan Prince1-0/+5
Adds support for a new 'primary' interface option exposed via the object model and JSON parsers which can be used to force the MAC address on a bridge. Only one interface on a given bridge (or bond) may be set as the primary interface. Also, update the ifcfg and eni providers so that they use OVS_EXTRA (or ovs_extra) to pin the mac accordingly.
2014-08-11Use --noop instead of --mock.Dan Prince1-3/+10
Updates the apply() function for each NetConfig object so that it now accepts noop instead. Also, the updated files are not returned (always instead of conditionally if mock was used).
2014-08-11Adds mock ability to the ENI and Ifcfg providersmarios1-1/+3
Specifying mock=True for 'apply' will return a string representing the changes required, or commands to be used in order to implement the requested/specified configuration. This is also exposed to the cli, with -m (--mock), e.g. os-net-config --mock -c ./etc/example_os_net_config_1.json -p eni
2014-07-08Add logging to the eni provider.Dan Prince1-3/+21
2014-07-07Add copyrights to files.Dan Prince1-1/+2
2014-07-03ENI: bring up bridges first on DebianDan Prince1-4/+8
We should bring up the interfaces on boot in the same order with which we bring them up in this tool.
2014-07-02ENI: enable 'auto' on bridges by defaultDan Prince1-0/+1
2014-07-02Update impl_eni to set the MTU.Dan Prince1-0/+2
2014-07-02Add vlan support for the ENI implementation.Dan Prince1-5/+32
2014-07-02Update impl_eni so it ifup's the interfacesDan Prince1-2/+6
We were shutting the interfaces down but not bringing them up again. This fixes that...
2014-07-02ENI fixes for v4/v6 ips. DHCP test fixes.Dan Prince1-20/+29
Updates the ENI format so it creates multiple config sections for a single os-net-config interface object if both v4 and v6 IP addresses are defined. Also, fixes several of the test so that DHCP is not enabled on OvsPorts. If an OVS port is part of a bridge that is itself using DHCP we don't also need to run DHCP on the OvsPort interface.
2014-06-25Vlan object and support for ifcfg.Dan Prince1-2/+3
Add ifcfg configuration support for Vlans and Vlan OVS ports.
2014-06-24Initial commit for basic ENI Debian/Ubuntu network configmarios1-0/+132
This uses /etc/network/interfaces single file format. Includes basic tests