diff --git a/paunch/builder/base.py b/paunch/builder/base.py index f9fee2a..e119c3b 100644 --- a/paunch/builder/base.py +++ b/paunch/builder/base.py @@ -212,7 +212,9 @@ class BaseBuilder(object): for image in sorted(images): # only pull if the image does not exist locally - if self.runner.inspect(image, format='exists', type='image'): + if self.runner.inspect(image, + output_format='exists', + o_type='image'): continue try: diff --git a/paunch/runner.py b/paunch/runner.py index 14abbf8..108d49d 100644 --- a/paunch/runner.py +++ b/paunch/runner.py @@ -73,17 +73,17 @@ class BaseRunner(object): return [c for c in cmd_stdout.split()] - def inspect(self, name, format=None, type='container'): - cmd = [self.cont_cmd, 'inspect', '--type', type] - if format: + def inspect(self, name, output_format=None, o_type='container'): + cmd = [self.cont_cmd, 'inspect', '--type', o_type] + if output_format: cmd.append('--format') - cmd.append(format) + cmd.append(output_format) cmd.append(name) (cmd_stdout, cmd_stderr, returncode) = self.execute(cmd, self.log) if returncode != 0: return try: - if format: + if output_format: return cmd_stdout else: return json.loads(cmd_stdout)[0] @@ -93,7 +93,7 @@ class BaseRunner(object): def unique_container_name(self, container): container_name = container - while self.inspect(container_name, format='exists'): + while self.inspect(container_name, output_format='exists'): suffix = ''.join(random.choice( string.ascii_lowercase + string.digits) for i in range(8)) container_name = '%s-%s' % (container, suffix) diff --git a/paunch/tests/test_runner.py b/paunch/tests/test_runner.py index 0a71e16..51c4435 100644 --- a/paunch/tests/test_runner.py +++ b/paunch/tests/test_runner.py @@ -90,7 +90,7 @@ class TestBaseRunner(base.TestCase): self.assertEqual( "bar", - self.runner.inspect('one', format='{{foo}}') + self.runner.inspect('one', output_format='{{foo}}') ) self.assert_execute( popen, ['docker', 'inspect', '--type', 'container',