diff --git a/os_refresh_config/os_refresh_config.py b/os_refresh_config/os_refresh_config.py index 9aabea5..a507cd6 100644 --- a/os_refresh_config/os_refresh_config.py +++ b/os_refresh_config/os_refresh_config.py @@ -114,8 +114,8 @@ def main(argv=sys.argv): lock = open(options.lockfile, 'a') try: fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB) - except IOError as e: - log.error('Could not lock %s. %s' % (options.lockfile, e)) + except OSError as e: + log.error('Could not lock {}. {}'.format(options.lockfile, e)) return e.errno lock.truncate(0) @@ -144,7 +144,7 @@ def main(argv=sys.argv): sys.stderr.flush() log.info('Completed phase %s' % phase) except subprocess.CalledProcessError as e: - log.error("during %s phase. [%s]\n" % (phase, e)) + log.error("during {} phase. [{}]\n".format(phase, e)) error_dir = os.path.join(BASE_DIR, 'error.d') if os.path.exists(error_dir): log.info('Calling error handlers.') diff --git a/os_refresh_config/tests/functional/test_cmd.py b/os_refresh_config/tests/functional/test_cmd.py index a409130..599a4f0 100644 --- a/os_refresh_config/tests/functional/test_cmd.py +++ b/os_refresh_config/tests/functional/test_cmd.py @@ -21,7 +21,7 @@ import testtools class TestCmd(testtools.TestCase): def setUp(self): - super(TestCmd, self).setUp() + super().setUp() self.useFixture(fixtures.NestedTempfile()) self.base_dir = self.useFixture(fixtures.TempDir()) self.lockdir = self.useFixture(fixtures.TempDir()) diff --git a/os_refresh_config/tests/unit/test_main.py b/os_refresh_config/tests/unit/test_main.py index a4a4b09..a8a26fc 100644 --- a/os_refresh_config/tests/unit/test_main.py +++ b/os_refresh_config/tests/unit/test_main.py @@ -22,7 +22,7 @@ from os_refresh_config import os_refresh_config class TestMain(testtools.TestCase): def setUp(self): - super(TestMain, self).setUp() + super().setUp() self.useFixture(fixtures.NestedTempfile()) td = self.useFixture(fixtures.TempDir()) self.useFixture(