diff options
author | Ben Nemec <bnemec@redhat.com> | 2017-05-23 16:19:30 +0000 |
---|---|---|
committer | Ben Nemec <bnemec@redhat.com> | 2017-05-30 20:17:21 +0000 |
commit | 5c840c4941d8401ee3c2d15c9a6cfb4f6a074deb (patch) | |
tree | 38ccfcc98076fafbb10dccf6fd1674057074e9ba /os_net_config/impl_ifcfg.py | |
parent | e7e81ac01122dd1b7711116d583a69fb655e0bca (diff) |
Continue bringing up interfaces even if one fails
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
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r-- | os_net_config/impl_ifcfg.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 6f35688..d9d362d 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -1054,4 +1054,11 @@ class IfcfgNetConfig(os_net_config.NetConfig): logger.info('Updating VPP mapping') utils.update_vpp_mapping(vpp_interfaces) + if self.errors: + message = 'Failure(s) occurred when applying configuration' + logger.error(message) + for e in self.errors: + logger.error('stdout: %s, stderr: %s', e.stdout, e.stderr) + raise os_net_config.ConfigurationError(message) + return update_files |