From ca12b69fce06c6146c3e376a6f60008a9ccdaade Mon Sep 17 00:00:00 2001 From: Mark Waldaukat Date: Mon, 16 Sep 2019 11:18:04 +0200 Subject: [PATCH] fix(pull): Fix pull container input with nested directories Error was: OSError: [Errno 17] File exists: '/tmp/infrabox/b5765a38-46c0-4455-94e1-087d653f074d/inputs/mirror-images' --- infraboxcli/pull.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infraboxcli/pull.py b/infraboxcli/pull.py index 86687e5..231fa4e 100644 --- a/infraboxcli/pull.py +++ b/infraboxcli/pull.py @@ -64,7 +64,7 @@ def pull(args): for d in manifest['dependencies']: p = os.path.join(inputs_path, d['name']) logger.info('Downloading output of %s to %s' % (d['name'], p)) - os.makedirs(p) + os.makedirs(p, exist_ok=True) package_path = os.path.join(download_path, '%s.%s' % (d['id'], d['output']['format'])) download_file(d['output']['url'], package_path, args)