forked from ungleich-public/cdist
merge changelog
Signed-off-by: Nico Schottelius <nico@brief.schottelius.org>
This commit is contained in:
commit
4faad3926b
5 changed files with 22 additions and 5 deletions
|
|
@ -19,7 +19,17 @@
|
|||
#
|
||||
#
|
||||
|
||||
VERSION = "2.0.10"
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
with open(os.devnull, 'w') as devnull:
|
||||
here = os.path.dirname(os.path.realpath(__file__))
|
||||
VERSION = subprocess.check_output(
|
||||
'cd "%s" && git describe' % here,
|
||||
stderr=devnull, shell=True).decode('utf-8')
|
||||
except:
|
||||
VERSION = "2.0.10"
|
||||
|
||||
BANNER = """
|
||||
.. . .x+=:. s
|
||||
|
|
@ -38,8 +48,6 @@ BANNER = """
|
|||
DOT_CDIST = ".cdist"
|
||||
|
||||
|
||||
import os
|
||||
|
||||
class Error(Exception):
|
||||
"""Base exception class for this project"""
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ class Local(object):
|
|||
|
||||
self.log = logging.getLogger(self.target_host)
|
||||
|
||||
# Setup file permissions using umask
|
||||
os.umask(0o077)
|
||||
|
||||
def create_directories(self):
|
||||
self.mkdir(self.out_path)
|
||||
self.mkdir(self.global_explorer_out_path)
|
||||
|
|
@ -73,8 +76,7 @@ class Local(object):
|
|||
def mkdir(self, path):
|
||||
"""Create directory on the local side."""
|
||||
self.log.debug("Local mkdir: %s", path)
|
||||
# FIXME: dont set mode here, fix unittest mkdtemp instead
|
||||
os.makedirs(path, mode=0o700, exist_ok=True)
|
||||
os.makedirs(path, exist_ok=True)
|
||||
|
||||
def run(self, command, env=None, return_output=False):
|
||||
"""Run the given command with the given environment.
|
||||
|
|
|
|||
|
|
@ -105,6 +105,10 @@ class Remote(object):
|
|||
cmd = self._exec.split()
|
||||
cmd.append(self.target_host)
|
||||
|
||||
# Always call umask before actual call to ensure proper file permissions
|
||||
cmd.append("umask 077;")
|
||||
|
||||
# FIXME: replace this by -o SendEnv name -o SendEnv name ... to ssh?
|
||||
# can't pass environment to remote side, so prepend command with
|
||||
# variable declarations
|
||||
if env:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue