From a875d69d7e9dc6dabdcd33c0ee4d33dd13640376 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Wed, 5 Oct 2011 14:15:05 +0200 Subject: [PATCH] continue on test_path testcase Signed-off-by: Nico Schottelius --- lib/cdist/config_install.py | 5 +++-- lib/cdist/install.py | 6 ++++++ lib/cdist/test/test_path.py | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/cdist/config_install.py b/lib/cdist/config_install.py index f7bd43e8..cd8ea720 100644 --- a/lib/cdist/config_install.py +++ b/lib/cdist/config_install.py @@ -26,11 +26,11 @@ import os import stat import sys -log = logging.getLogger(__name__) - import cdist.emulator import cdist.path +log = logging.getLogger(__name__) + CODE_HEADER = "#!/bin/sh -e\n" class ConfigInstall: @@ -203,6 +203,7 @@ class ConfigInstall: outfile_fd = open(outfile, "w") # Need to flush to ensure our write is done before stdout write + # FIXME: CODE_HEADER needed in our sh -e scenario???? outfile_fd.write(CODE_HEADER) outfile_fd.flush() diff --git a/lib/cdist/install.py b/lib/cdist/install.py index 98b388ec..5a35626d 100644 --- a/lib/cdist/install.py +++ b/lib/cdist/install.py @@ -22,8 +22,14 @@ import logging +import cdist.config_install + log = logging.getLogger(__name__) + +Class Install(cdist.config_install.ConfigInstall): + pass + def install(args): """Install remote system""" process = {} diff --git a/lib/cdist/test/test_path.py b/lib/cdist/test/test_path.py index c8ca95c0..f86c8fad 100644 --- a/lib/cdist/test/test_path.py +++ b/lib/cdist/test/test_path.py @@ -66,12 +66,12 @@ class Path(unittest.TestCase): """Check that objects created from manifest are only of install type""" manifest_fd = open(self.init_manifest, "w") manifest_fd.writelines(["#!/bin/sh\n", - "__file " + self.temp_dir + " --mode 0700\n", - "__partition_msdos /dev/null --type 82\n", + self.install_type_name + "testid\n", + self.config_type_name + "testid\n", ]) manifest_fd.close() - self.config.run_initial_manifest() + self.install.run_initial_manifest() # FIXME: check that only __partition_msdos objects are created!