also allow to overwrite remote_base_dir

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
remotes/origin/feature_files_export
Nico Schottelius 14 years ago
parent 4b306e45f9
commit 9540d529d6
  1. 17
      lib/cdist/path.py

17
lib/cdist/path.py vendored

@ -25,12 +25,6 @@ import shutil
import sys
import tempfile
# Hardcoded paths usually not changable
REMOTE_BASE_DIR = "/var/lib/cdist"
REMOTE_CONF_DIR = os.path.join(REMOTE_BASE_DIR, "conf")
REMOTE_OBJECT_DIR = os.path.join(REMOTE_BASE_DIR, "object")
REMOTE_TYPE_DIR = os.path.join(REMOTE_CONF_DIR, "type")
REMOTE_GLOBAL_EXPLORER_DIR = os.path.join(REMOTE_CONF_DIR, "explorer")
log = logging.getLogger(__name__)
@ -74,6 +68,17 @@ class Path:
self.object_base_dir = os.path.join(self.out_dir, "object")
self.bin_dir = os.path.join(self.out_dir, "bin")
# Remote directories
if "__cdist_remote_base_dir" in os.environ:
self.remote_base_dir = os.environ['__cdist_remote_base_dir']
else:
self.remote_base_dir = "/var/lib/cdist"
self.remote_conf_dir = os.path.join(self.remote_base_dir, "conf")
self.remote_object_dir = os.path.join(self.remote_base_dir, "object")
self.remote_type_dir = os.path.join(self.remote_conf_dir, "type")
self.remote_global_explorer_dir = os.path.join(self.remote_conf_dir, "explorer")
# Create directories
self.__init_out_dirs()

Loading…
Cancel
Save