diff options
author | Daniel Watkins <oddbloke@ubuntu.com> | 2020-03-27 12:29:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 12:29:05 -0400 |
commit | 36a597de6f130a17360856697759b08f3c835df1 (patch) | |
tree | 660b634629c63de3e6c9bcdae978f931ff016bbc /cloudinit/tests/helpers.py | |
parent | 41cc2014ae2df5bfa61496c8adb88d132008294b (diff) | |
download | vyos-cloud-init-36a597de6f130a17360856697759b08f3c835df1.tar.gz vyos-cloud-init-36a597de6f130a17360856697759b08f3c835df1.zip |
CiTestCase: remove now-unneeded parse_and_read helper method (#286)
(And sort some imports where I was changing them.)
Diffstat (limited to 'cloudinit/tests/helpers.py')
-rw-r--r-- | cloudinit/tests/helpers.py | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/cloudinit/tests/helpers.py b/cloudinit/tests/helpers.py index 8adb9e75..8d3512db 100644 --- a/cloudinit/tests/helpers.py +++ b/cloudinit/tests/helpers.py @@ -23,11 +23,6 @@ try: except ImportError: from contextlib2 import ExitStack, contextmanager -try: - from configparser import ConfigParser -except ImportError: - from ConfigParser import ConfigParser - from cloudinit.config.schema import ( SchemaValidationError, validate_cloudconfig_schema) from cloudinit import cloud @@ -114,16 +109,6 @@ class TestCase(unittest2.TestCase): self.addCleanup(m.stop) setattr(self, attr, p) - # prefer python3 read_file over readfp but allow fallback - def parse_and_read(self, contents): - parser = ConfigParser() - if hasattr(parser, 'read_file'): - parser.read_file(contents) - elif hasattr(parser, 'readfp'): - # pylint: disable=W1505 - parser.readfp(contents) - return parser - class CiTestCase(TestCase): """This is the preferred test case base class unless user |