Fixed integration issue with cryptsetup; unit tests now pass
This commit is contained in:
parent
7032d06020
commit
9add2a7b34
4 changed files with 12 additions and 14 deletions
1
bin/cryptobox.conf
Symbolic link
1
bin/cryptobox.conf
Symbolic link
|
@ -0,0 +1 @@
|
|||
cryptobox-unittests.conf
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue