From 4ba4df2f00ab1763920280f76e2b4497898858af Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 12 May 2016 16:43:11 -0400 Subject: run flake8 instead of pyflakes in tox. expect tests/ to pass flake8. --- tests/unittests/test_datasource/test_azure_helper.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/unittests/test_datasource/test_azure_helper.py') diff --git a/tests/unittests/test_datasource/test_azure_helper.py b/tests/unittests/test_datasource/test_azure_helper.py index 1134199b..921bc978 100644 --- a/tests/unittests/test_datasource/test_azure_helper.py +++ b/tests/unittests/test_datasource/test_azure_helper.py @@ -1,6 +1,7 @@ import os from cloudinit.sources.helpers import azure as azure_helper + from ..helpers import TestCase try: -- cgit v1.2.3 From 811f7b5b3c4590ee4a16662db37b1f37541d9822 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 12 May 2016 16:52:56 -0400 Subject: fix last flake8 error --- cloudinit/sources/helpers/azure.py | 2 +- tests/unittests/test_datasource/test_azure_helper.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unittests/test_datasource/test_azure_helper.py') diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py index bbfc283c..63ccf10e 100644 --- a/cloudinit/sources/helpers/azure.py +++ b/cloudinit/sources/helpers/azure.py @@ -221,7 +221,7 @@ class WALinuxAgentShim(object): if 'unknown-245' in line: value = line.strip(' ').split(' ', 2)[-1].strip(';\n"') if value is None: - raise Exception('No endpoint found in DHCP config.') + raise ValueError('No endpoint found in DHCP config.') endpoint_ip_address = WALinuxAgentShim.get_ip_from_lease_value(value) LOG.debug('Azure endpoint found at %s', endpoint_ip_address) return endpoint_ip_address diff --git a/tests/unittests/test_datasource/test_azure_helper.py b/tests/unittests/test_datasource/test_azure_helper.py index 921bc978..d07a1f07 100644 --- a/tests/unittests/test_datasource/test_azure_helper.py +++ b/tests/unittests/test_datasource/test_azure_helper.py @@ -71,7 +71,7 @@ class TestFindEndpoint(TestCase): def test_missing_special_azure_line(self): self.load_file.return_value = '' - self.assertRaises(Exception, + self.assertRaises(ValueError, azure_helper.WALinuxAgentShim.find_endpoint) @staticmethod -- cgit v1.2.3