summaryrefslogtreecommitdiff
path: root/tests/unittests/config/test_cc_disable_ec2_metadata.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unittests/config/test_cc_disable_ec2_metadata.py')
-rw-r--r--tests/unittests/config/test_cc_disable_ec2_metadata.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/unittests/config/test_cc_disable_ec2_metadata.py b/tests/unittests/config/test_cc_disable_ec2_metadata.py
index 5755e29e..dedfd187 100644
--- a/tests/unittests/config/test_cc_disable_ec2_metadata.py
+++ b/tests/unittests/config/test_cc_disable_ec2_metadata.py
@@ -2,7 +2,6 @@
"""Tests cc_disable_ec2_metadata handler"""
-import logging
import pytest
@@ -14,8 +13,6 @@ from cloudinit.config.schema import (
)
from tests.unittests.helpers import CiTestCase, mock, skipUnlessJsonSchema
-LOG = logging.getLogger(__name__)
-
DISABLE_CFG = {"disable_ec2_metadata": "true"}
@@ -25,7 +22,7 @@ class TestEC2MetadataRoute(CiTestCase):
def test_disable_ifconfig(self, m_subp, m_which):
"""Set the route if ifconfig command is available"""
m_which.side_effect = lambda x: x if x == "ifconfig" else None
- ec2_meta.handle("foo", DISABLE_CFG, None, LOG, None)
+ ec2_meta.handle("foo", DISABLE_CFG, None, None)
m_subp.assert_called_with(
["route", "add", "-host", "169.254.169.254", "reject"],
capture=False,
@@ -36,7 +33,7 @@ class TestEC2MetadataRoute(CiTestCase):
def test_disable_ip(self, m_subp, m_which):
"""Set the route if ip command is available"""
m_which.side_effect = lambda x: x if x == "ip" else None
- ec2_meta.handle("foo", DISABLE_CFG, None, LOG, None)
+ ec2_meta.handle("foo", DISABLE_CFG, None, None)
m_subp.assert_called_with(
["ip", "route", "add", "prohibit", "169.254.169.254"],
capture=False,
@@ -47,7 +44,7 @@ class TestEC2MetadataRoute(CiTestCase):
def test_disable_no_tool(self, m_subp, m_which):
"""Log error when neither route nor ip commands are available"""
m_which.return_value = None # Find neither ifconfig nor ip
- ec2_meta.handle("foo", DISABLE_CFG, None, LOG, None)
+ ec2_meta.handle("foo", DISABLE_CFG, None, None)
self.assertEqual(
[mock.call("ip"), mock.call("ifconfig")], m_which.call_args_list
)