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 = []