Add derived env vars for target hostname and fqdn.

This commit is contained in:
Darko Poljak 2016-08-10 23:56:56 +02:00
commit dbcc94ab65
23 changed files with 181 additions and 59 deletions

View file

@ -83,7 +83,7 @@ class Local(object):
return None
def _init_log(self):
self.log = logging.getLogger(self.target_host)
self.log = logging.getLogger(self.target_host[0])
def _init_permissions(self):
# Setup file permissions using umask
@ -184,8 +184,11 @@ class Local(object):
if env is None:
env = os.environ.copy()
# Export __target_host for use in __remote_{copy,exec} scripts
env['__target_host'] = self.target_host
# Export __target_host, __target_hostname, __target_fqdn
# for use in __remote_{copy,exec} scripts
env['__target_host'] = self.target_host[0]
env['__target_hostname'] = self.target_host[1]
env['__target_fqdn'] = self.target_host[2]
# Export for emulator
env['__cdist_object_marker'] = self.object_marker_name