Fixed integration issue with cryptsetup; unit tests now pass
This commit is contained in:
parent
7032d06020
commit
9add2a7b34
1
bin/cryptobox.conf
Symbolic link
1
bin/cryptobox.conf
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
cryptobox-unittests.conf
|
|
@ -337,7 +337,7 @@ class Blockdevice:
|
||||||
prefs["Programs"]["super"],
|
prefs["Programs"]["super"],
|
||||||
prefs["Programs"]["CryptoBoxRootActions"],
|
prefs["Programs"]["CryptoBoxRootActions"],
|
||||||
"program", "cryptsetup",
|
"program", "cryptsetup",
|
||||||
"--batch-mode", "isLuks", self.devnodes[0]])
|
"isLuks", self.devnodes[0]])
|
||||||
proc.wait()
|
proc.wait()
|
||||||
result = proc.returncode == 0
|
result = proc.returncode == 0
|
||||||
## store result and return
|
## store result and return
|
||||||
|
|
|
@ -738,16 +738,17 @@ class CryptoBoxContainer:
|
||||||
loc_data.child_pid = os.fork()
|
loc_data.child_pid = os.fork()
|
||||||
if loc_data.child_pid == 0:
|
if loc_data.child_pid == 0:
|
||||||
## make the filesystem
|
## 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(
|
loc_data.proc = subprocess.Popen(
|
||||||
shell = False,
|
shell = False,
|
||||||
stdin = None,
|
stdin = None,
|
||||||
stdout = subprocess.PIPE,
|
stdout = subprocess.PIPE,
|
||||||
stderr = subprocess.PIPE,
|
stderr = subprocess.PIPE,
|
||||||
args = [
|
args = mkfs_args)
|
||||||
self.cbox.prefs["Programs"]["nice"],
|
self.cbox.log.debug("Will format LUKS device using `%s'" % mkfs_args)
|
||||||
self.cbox.prefs["Programs"]["mkfs"],
|
|
||||||
"-t", fs_type,
|
|
||||||
plain_device ] )
|
|
||||||
loc_data.proc.wait()
|
loc_data.proc.wait()
|
||||||
## wait to allow error detection
|
## wait to allow error detection
|
||||||
if loc_data.proc.returncode == 0:
|
if loc_data.proc.returncode == 0:
|
||||||
|
|
|
@ -95,16 +95,12 @@ class CryptoBox:
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
## basicConfig(...) needs python >= 2.4
|
## basicConfig(...) needs python >= 2.4
|
||||||
################################################
|
|
||||||
## Set the default log level here:
|
|
||||||
DEFAULT_LOG_LEVEL=logging.ERROR
|
|
||||||
################################################
|
|
||||||
try:
|
try:
|
||||||
log_handler = logging.getLogger("CryptoNAS")
|
log_handler = logging.getLogger("CryptoNAS")
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
format = '%(asctime)s CryptoNAS %(levelname)s: %(message)s',
|
format = '%(asctime)s CryptoNAS %(levelname)s: %(message)s',
|
||||||
stderr = sys.stderr)
|
stderr = sys.stderr)
|
||||||
log_handler.setLevel(DEFAULT_LOG_LEVEL)
|
log_handler.setLevel(logging.ERROR)
|
||||||
log_handler.info("loggingsystem is up'n running")
|
log_handler.info("loggingsystem is up'n running")
|
||||||
## from now on everything can be logged via self.log...
|
## from now on everything can be logged via self.log...
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in a new issue