set __cdist_dry_run env var if dry-run

This commit is contained in:
ander 2019-05-16 21:58:47 +02:00 • committed by Darko Poljak
commit 69622b0fa5
6 changed files with 32 additions and 6 deletions

View file

@ -67,7 +67,7 @@ class Explorer(object):
"""Executes cdist explorers.
"""
def __init__(self, target_host, local, remote, jobs=None):
def __init__(self, target_host, local, remote, jobs=None, dry_run=False):
self.target_host = target_host
self._open_logger()
@ -84,6 +84,10 @@ class Explorer(object):
'__cdist_log_level_name': util.log_level_name_env_var_val(
self.log),
}
if dry_run:
self.env['__cdist_dry_run'] = '1'
self._type_explorers_transferred = []
self.jobs = jobs