summaryrefslogtreecommitdiff
path: root/google_compute_engine/networking/network_setup
diff options
context:
space:
mode:
Diffstat (limited to 'google_compute_engine/networking/network_setup')
-rwxr-xr-xgoogle_compute_engine/networking/network_setup/network_setup.py2
-rw-r--r--google_compute_engine/networking/network_setup/tests/network_setup_test.py16
2 files changed, 6 insertions, 12 deletions
diff --git a/google_compute_engine/networking/network_setup/network_setup.py b/google_compute_engine/networking/network_setup/network_setup.py
index 1408809..9166722 100755
--- a/google_compute_engine/networking/network_setup/network_setup.py
+++ b/google_compute_engine/networking/network_setup/network_setup.py
@@ -56,8 +56,6 @@ class NetworkSetup(object):
self.logger.info('Ethernet interfaces: %s.', interfaces)
self.interfaces = set(interfaces)
- if len(interfaces) <= 1:
- return
if self.dhcp_command:
try:
diff --git a/google_compute_engine/networking/network_setup/tests/network_setup_test.py b/google_compute_engine/networking/network_setup/tests/network_setup_test.py
index a148b78..644510a 100644
--- a/google_compute_engine/networking/network_setup/tests/network_setup_test.py
+++ b/google_compute_engine/networking/network_setup/tests/network_setup_test.py
@@ -72,29 +72,25 @@ class NetworkSetupTest(unittest.TestCase):
network_setup.NetworkSetup.EnableNetworkInterfaces(
self.mock_setup, ['A', 'B', 'C'])
self.assertEqual(self.mock_setup.interfaces, set(['A', 'B', 'C']))
- # A single interface is enabled by default.
- network_setup.NetworkSetup.EnableNetworkInterfaces(self.mock_setup, ['D'])
- self.assertEqual(self.mock_setup.interfaces, set(['D']))
# Run a user supplied command successfully.
self.mock_setup.dhcp_command = 'success'
network_setup.NetworkSetup.EnableNetworkInterfaces(
- self.mock_setup, ['E', 'F'])
- self.assertEqual(self.mock_setup.interfaces, set(['E', 'F']))
+ self.mock_setup, ['D', 'E'])
+ self.assertEqual(self.mock_setup.interfaces, set(['D', 'E']))
# Run a user supplied command and logger error messages.
self.mock_setup.dhcp_command = 'failure'
network_setup.NetworkSetup.EnableNetworkInterfaces(
- self.mock_setup, ['G', 'H'])
- self.assertEqual(self.mock_setup.interfaces, set(['G', 'H']))
+ self.mock_setup, ['F', 'G'])
+ self.assertEqual(self.mock_setup.interfaces, set(['F', 'G']))
expected_calls = [
mock.call.logger.info(mock.ANY, ['A', 'B']),
mock.call.enable(['A', 'B'], mock.ANY, dhclient_script='/bin/script'),
mock.call.logger.info(mock.ANY, ['A', 'B', 'C']),
mock.call.enable(
['A', 'B', 'C'], mock.ANY, dhclient_script='/bin/script'),
- mock.call.logger.info(mock.ANY, ['D']),
- mock.call.logger.info(mock.ANY, ['E', 'F']),
+ mock.call.logger.info(mock.ANY, ['D', 'E']),
mock.call.call(['success']),
- mock.call.logger.info(mock.ANY, ['G', 'H']),
+ mock.call.logger.info(mock.ANY, ['F', 'G']),
mock.call.call(['failure']),
mock.call.logger.warning(mock.ANY),
]