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_eni.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_eni.py')
-rw-r--r-- | os_net_config/impl_eni.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/os_net_config/impl_eni.py b/os_net_config/impl_eni.py index 360d8c8..944c4e9 100644 --- a/os_net_config/impl_eni.py +++ b/os_net_config/impl_eni.py @@ -241,6 +241,14 @@ class ENINetConfig(os_net_config.NetConfig): for interface in self.interfaces.keys(): self.ifup(interface) + + 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) else: logger.info('No interface changes are required.') |