backport ignoring install types in config mode from install_integration branch

Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
Nico Schottelius 2014-01-29 22:40:59 +01:00
parent aa3e92f07b
commit 16d51b3cf1
2 changed files with 10 additions and 1 deletions

View file

@ -163,8 +163,12 @@ class Config(object):
"""Short name for object list retrieval"""
for cdist_object in core.CdistObject.list_objects(self.local.object_path,
self.local.type_path):
if cdist_object.cdist_type.is_install:
self.log.debug("Running in config mode, ignoring install object: {0}".format(cdist_object))
else:
yield cdist_object
def iterate_once(self):
"""
Iterate over the objects once - helper method for

View file

@ -101,6 +101,11 @@ class CdistType(object):
"""Check whether a type is a singleton."""
return os.path.isfile(os.path.join(self.absolute_path, "singleton"))
@property
def is_install(self):
"""Check whether a type is used for installation (if not: for configuration)"""
return os.path.isfile(os.path.join(self.absolute_path, "install"))
@property
def explorers(self):
"""Return a list of available explorers"""