From 9add2a7b3465e9c23bcc9ba8d5610886a38e1854 Mon Sep 17 00:00:00 2001 From: frisco <> Date: Mon, 25 May 2009 02:37:15 +0000 Subject: [PATCH] Fixed integration issue with cryptsetup; unit tests now pass --- bin/cryptobox.conf | 1 + src/cryptobox/core/blockdevice.py | 8 ++++---- src/cryptobox/core/container.py | 11 ++++++----- src/cryptobox/core/main.py | 6 +----- 4 files changed, 12 insertions(+), 14 deletions(-) create mode 120000 bin/cryptobox.conf diff --git a/bin/cryptobox.conf b/bin/cryptobox.conf new file mode 120000 index 0000000..49e4717 --- /dev/null +++ b/bin/cryptobox.conf @@ -0,0 +1 @@ +cryptobox-unittests.conf \ No newline at end of file diff --git a/src/cryptobox/core/blockdevice.py b/src/cryptobox/core/blockdevice.py index 813e926..d6efe06 100644 --- a/src/cryptobox/core/blockdevice.py +++ b/src/cryptobox/core/blockdevice.py @@ -334,10 +334,10 @@ class Blockdevice: stdout = subprocess.PIPE, stderr = subprocess.PIPE, args = [ - prefs["Programs"]["super"], - prefs["Programs"]["CryptoBoxRootActions"], - "program", "cryptsetup", - "--batch-mode", "isLuks", self.devnodes[0]]) + prefs["Programs"]["super"], + prefs["Programs"]["CryptoBoxRootActions"], + "program", "cryptsetup", + "isLuks", self.devnodes[0]]) proc.wait() result = proc.returncode == 0 ## store result and return diff --git a/src/cryptobox/core/container.py b/src/cryptobox/core/container.py index 9338854..e0c3f78 100644 --- a/src/cryptobox/core/container.py +++ b/src/cryptobox/core/container.py @@ -738,16 +738,17 @@ class CryptoBoxContainer: loc_data.child_pid = os.fork() if loc_data.child_pid == 0: ## make the filesystem + mkfs_args = [ self.cbox.prefs["Programs"]["nice"], + self.cbox.prefs["Programs"]["mkfs"], + "-t", fs_type, + plain_device ] loc_data.proc = subprocess.Popen( shell = False, stdin = None, stdout = subprocess.PIPE, stderr = subprocess.PIPE, - args = [ - self.cbox.prefs["Programs"]["nice"], - self.cbox.prefs["Programs"]["mkfs"], - "-t", fs_type, - plain_device ] ) + args = mkfs_args) + self.cbox.log.debug("Will format LUKS device using `%s'" % mkfs_args) loc_data.proc.wait() ## wait to allow error detection if loc_data.proc.returncode == 0: diff --git a/src/cryptobox/core/main.py b/src/cryptobox/core/main.py index d9aab31..5a78d1a 100644 --- a/src/cryptobox/core/main.py +++ b/src/cryptobox/core/main.py @@ -95,16 +95,12 @@ class CryptoBox: """ import logging ## basicConfig(...) needs python >= 2.4 - ################################################ - ## Set the default log level here: - DEFAULT_LOG_LEVEL=logging.ERROR - ################################################ try: log_handler = logging.getLogger("CryptoNAS") logging.basicConfig( format = '%(asctime)s CryptoNAS %(levelname)s: %(message)s', stderr = sys.stderr) - log_handler.setLevel(DEFAULT_LOG_LEVEL) + log_handler.setLevel(logging.ERROR) log_handler.info("loggingsystem is up'n running") ## from now on everything can be logged via self.log... except: