diff --git a/bin/cdist b/bin/cdist index d9f88b48..69e0623f 100755 --- a/bin/cdist +++ b/bin/cdist @@ -20,6 +20,10 @@ # # +# Add our own library path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), + '../lib/python'))) + import argparse import datetime import logging @@ -32,6 +36,8 @@ import stat import sys import tempfile +import cdist.path + BANNER = """ .. . .x+=:. s dF @88> z` ^% :8 @@ -62,11 +68,6 @@ VERSION = "2.0.1" logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s') log = logging.getLogger() -# Begin to split into parts -sys.path.insert(0, - os.path.abspath(os.path.join(os.path.dirname(__file__), - '../lib/python'))) - def file_to_list(filename): """Return list from \n seperated file""" if os.path.isfile(filename): @@ -94,6 +95,8 @@ class Cdist: self.target_host = target_host self.remote_prefix = ["ssh", "root@" + self.target_host] + self.path_info = cdist.path.Path(target_host, home) + # Setup directory paths self.temp_dir = tempfile.mkdtemp() diff --git a/module/cdist/__init__.py b/lib/cdist/__init__.py similarity index 100% rename from module/cdist/__init__.py rename to lib/cdist/__init__.py diff --git a/module/cdist/path.py b/lib/cdist/path.py similarity index 100% rename from module/cdist/path.py rename to lib/cdist/path.py