From 807c68890da795423282232ab599a597a615ace7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 8 May 2020 14:43:54 -0400 Subject: [PATCH] Fix import error Attempted to make the same directory twice. --- confluent_server/confluent/osimage.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 4cc072e5..39eff8db 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -335,11 +335,8 @@ class MediaImporter(object): if identity.get('subname', None): targpath += '/' + identity['subname'] self.targpath = '/var/lib/confluent/distributions/' + targpath - try: - os.makedirs(self.targpath) - except OSError as e: - if e.errno != 17: - raise + if os.path.exists(self.targpath): + raise Exception('{0} already exists'.format(self.targpath)) self.filename = os.path.abspath(media) self.importer = eventlet.spawn(self.importmedia) self.profiles = []