diff --git a/confluent_server/confluent/core.py b/confluent_server/confluent/core.py index 72cc254c..c155356f 100644 --- a/confluent_server/confluent/core.py +++ b/confluent_server/confluent/core.py @@ -144,19 +144,19 @@ class PluginCollection(object): def handle_deployment(configmanager, inputdata, pathcomponents, operation): if len(pathcomponents) == 1: - yield msg.ChildCollection('distributions') - yield msg.ChildCollection('profiles') - yield msg.ChildCollection('importing') + yield msg.ChildCollection('distributions/') + yield msg.ChildCollection('profiles/') + yield msg.ChildCollection('importing/') return if pathcomponents[1] == 'distributions': if len(pathcomponents) == 2: for dist in osimage.list_distros(): - yield msg.ChildCollection(dist) + yield msg.ChildCollection(dist + '/') return if pathcomponents[1] == 'profiles': if len(pathcomponents) == 2: for prof in osimage.list_profiles(): - yield msg.ChildCollection(prof) + yield msg.ChildCollection(prof + '/') return if pathcomponents[1] == 'importing': if len(pathcomponents) == 2 or not pathcomponents[-1]: diff --git a/confluent_server/confluent/osimage.py b/confluent_server/confluent/osimage.py index 39eff8db..41882bdc 100644 --- a/confluent_server/confluent/osimage.py +++ b/confluent_server/confluent/osimage.py @@ -315,6 +315,7 @@ importing = {} class MediaImporter(object): def __init__(self, media): + self.worker = None identity = fingerprint(media) self.percent = 0.0 identity, _ = identity @@ -342,7 +343,7 @@ class MediaImporter(object): self.profiles = [] def stop(self): - if self.worker.poll() is None: + if self.worker and self.worker.poll() is None: self.worker.kill() @property