begin to used cdist.path

Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
Nico Schottelius 2011-09-23 18:55:23 +02:00
parent edfc54505b
commit 8e59f97800
3 changed files with 8 additions and 5 deletions

View file

@ -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 argparse
import datetime import datetime
import logging import logging
@ -32,6 +36,8 @@ import stat
import sys import sys
import tempfile import tempfile
import cdist.path
BANNER = """ BANNER = """
.. . .x+=:. s .. . .x+=:. s
dF @88> z` ^% :8 dF @88> z` ^% :8
@ -62,11 +68,6 @@ VERSION = "2.0.1"
logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s') logging.basicConfig(level=logging.INFO, format='%(levelname)s: %(message)s')
log = logging.getLogger() 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): def file_to_list(filename):
"""Return list from \n seperated file""" """Return list from \n seperated file"""
if os.path.isfile(filename): if os.path.isfile(filename):
@ -94,6 +95,8 @@ class Cdist:
self.target_host = target_host self.target_host = target_host
self.remote_prefix = ["ssh", "root@" + self.target_host] self.remote_prefix = ["ssh", "root@" + self.target_host]
self.path_info = cdist.path.Path(target_host, home)
# Setup directory paths # Setup directory paths
self.temp_dir = tempfile.mkdtemp() self.temp_dir = tempfile.mkdtemp()