summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2020-07-13 11:37:37 -0400
committerGitHub <noreply@github.com>2020-07-13 11:37:37 -0400
commitfecbd81889011e8a75badd18935297f3494fe485 (patch)
treeaf778e3fddd9d42ac2517de4e8a96d0cb628e62e
parentb9366677263ff7ec0f5b200900b22ba8871308a3 (diff)
downloadvyos-cloud-init-fecbd81889011e8a75badd18935297f3494fe485.tar.gz
vyos-cloud-init-fecbd81889011e8a75badd18935297f3494fe485.zip
Fix two minor warnings (#475)
-rw-r--r--cloudinit/config/cc_puppet.py4
-rw-r--r--tests/unittests/test_datasource/test_gce.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/config/cc_puppet.py b/cloudinit/config/cc_puppet.py
index 635c73bc..bc981cf4 100644
--- a/cloudinit/config/cc_puppet.py
+++ b/cloudinit/config/cc_puppet.py
@@ -160,9 +160,9 @@ def handle(name, cfg, cloud, log, _args):
cleaned_lines = [i.lstrip() for i in contents.splitlines()]
cleaned_contents = '\n'.join(cleaned_lines)
# Move to puppet_config.read_file when dropping py2.7
- puppet_config.readfp( # pylint: disable=W1505
+ puppet_config.read_file(
StringIO(cleaned_contents),
- filename=p_constants.conf_path)
+ source=p_constants.conf_path)
for (cfg_name, cfg) in puppet_cfg['conf'].items():
# Cert configuration is a special case
# Dump the puppet master ca certificate in the correct place
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py
index 4afbccff..01f4cbd1 100644
--- a/tests/unittests/test_datasource/test_gce.py
+++ b/tests/unittests/test_datasource/test_gce.py
@@ -114,7 +114,8 @@ class TestDataSourceGCE(test_helpers.HttprettyTestCase):
self.assertTrue(success)
req_header = httpretty.last_request().headers
- self.assertDictContainsSubset(HEADERS, req_header)
+ for header_name, expected_value in HEADERS.items():
+ self.assertEqual(expected_value, req_header.get(header_name))
def test_metadata(self):
# UnicodeDecodeError if set to ds.userdata instead of userdata_raw