forked from ungleich-public/cdist
setting up CDIST_ALLOW_OVERRIDE to any value is ok - do not depend on true/yes/ja
Signed-off-by: Nico Schottelius <nico@bento.schottelius.org>
This commit is contained in:
parent
65b3f6c75a
commit
34f2f7f038
3 changed files with 6 additions and 5 deletions
|
|
@ -145,14 +145,14 @@ class Emulator(object):
|
|||
if value is not None:
|
||||
self.parameters[key] = value
|
||||
|
||||
if self.cdist_object.exists and os.environ.get('CDIST_ALLOW_OVERRIDE',"false") != 'true':
|
||||
if self.cdist_object.exists and not 'CDIST_ALLOW_OVERRIDE' in os.environ:
|
||||
if self.cdist_object.parameters != self.parameters:
|
||||
raise cdist.Error("Object %s already exists with conflicting parameters:\n%s: %s\n%s: %s"
|
||||
% (self.cdist_object.name, " ".join(self.cdist_object.source), self.cdist_object.parameters, self.object_source, self.parameters)
|
||||
)
|
||||
else:
|
||||
if self.cdist_object.exists:
|
||||
self.log.debug('Object %s override forced with CDIST_ALLOW_OVERRIDE=true',self.cdist_object.name)
|
||||
self.log.debug('Object %s override forced with CDIST_ALLOW_OVERRIDE',self.cdist_object.name)
|
||||
self.cdist_object.create(True)
|
||||
else:
|
||||
self.cdist_object.create()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue