aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/tests/test_objects.py
diff options
context:
space:
mode:
authorBen Nemec <bnemec@redhat.com>2016-04-12 15:51:55 +0000
committerBen Nemec <bnemec@redhat.com>2016-04-12 16:55:50 +0000
commit34f7198267ba855f3f1e6dad0226493acc7f530d (patch)
treeeef45533e72e8d1d91e2347de7b67b66d5c3ab25 /os_net_config/tests/test_objects.py
parent1134091ff1a6a0fc9f8dc6fe4d70bf0274728fdd (diff)
Add warning for no active nics
When there are no active nics, strange errors can happen later in the process of applying the configuration, and it's often not obvious what caused them. Logging a warning should make it easier to track down such problems. Note that this should never happen legitimately in a TripleO environment since we always need to have at least one active nic to even get configuration to the system. However, it is a valid case for someone who might be applying a configuration with local access to a system, so it should be handled sanely. It's also helpful in case of future bugs in the active nic checking. Change-Id: Iaf6d4b1b215b70d61e0857e093a834702829e1b9 Related-Bug: 1569403
Diffstat (limited to 'os_net_config/tests/test_objects.py')
-rw-r--r--os_net_config/tests/test_objects.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/os_net_config/tests/test_objects.py b/os_net_config/tests/test_objects.py
index d3e41df..a4a5f8a 100644
--- a/os_net_config/tests/test_objects.py
+++ b/os_net_config/tests/test_objects.py
@@ -569,3 +569,9 @@ class TestNumberedNicsMapping(base.TestCase):
mapping = {'nic1': '12:34:56:de:f0:12', 'nic2': '12:34:56:78:9a:bc'}
expected = {'nic1': 'em2', 'nic2': 'em1'}
self.assertEqual(expected, objects._numbered_nics(nic_mapping=mapping))
+
+ def test_numbered_nics_no_active(self):
+ self._stub_active_nics([])
+ expected = {}
+ # This only emits a warning, so it should still work
+ self.assertEqual(expected, objects._numbered_nics())