use new cdist.Error exception

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-10-06 19:59:07 +02:00
parent d07a191867
commit a87e6f22b5

View file

@ -65,7 +65,7 @@ class ConfigInstall:
log.info("Running global explorers") log.info("Running global explorers")
explorers = self.path.list_global_explorers() explorers = self.path.list_global_explorers()
if(len(explorers) == 0): if(len(explorers) == 0):
raise CdistError("No explorers found in", self.path.global_explorer_dir) raise cdist.Error("No explorers found in", self.path.global_explorer_dir)
self.path.transfer_global_explorers() self.path.transfer_global_explorers()
for explorer in explorers: for explorer in explorers:
@ -159,6 +159,8 @@ class ConfigInstall:
def object_run(self, cdist_object, mode): def object_run(self, cdist_object, mode):
"""Run gencode or code for an object""" """Run gencode or code for an object"""
log.debug("Running %s from %s", mode, cdist_object) log.debug("Running %s from %s", mode, cdist_object)
# FIXME: replace with new object interface
file=os.path.join(self.path.object_dir(cdist_object), "require") file=os.path.join(self.path.object_dir(cdist_object), "require")
requirements = cdist.path.file_to_list(file) requirements = cdist.path.file_to_list(file)
type = self.path.get_type_from_object(cdist_object) type = self.path.get_type_from_object(cdist_object)
@ -230,7 +232,7 @@ class ConfigInstall:
"""The final (and real) step of deployment""" """The final (and real) step of deployment"""
log.info("Generating and executing code") log.info("Generating and executing code")
# Now do the final steps over the existing objects # Now do the final steps over the existing objects
for cdist_object in self.path.list_objects(): for cdist_object in cdist.core.Object.list_objects():
log.debug("Run object: %s", cdist_object) log.debug("Run object: %s", cdist_object)
self.object_run(cdist_object, mode="gencode") self.object_run(cdist_object, mode="gencode")
self.object_run(cdist_object, mode="code") self.object_run(cdist_object, mode="code")