output of log action fixed

added some RFCs
added some unittests for CryptoBox config handling
This commit is contained in:
lars 2006-08-25 07:37:52 +00:00
parent 3b97f675bf
commit 3fd2064439
5 changed files with 139 additions and 86 deletions

View file

@ -1,10 +1,6 @@
#!/usr/bin/env python2.4
"""
TODO: implement "getCapacity"
"""
# check python version
## check python version
import sys
(ver_major, ver_minor, ver_sub, ver_desc, ver_subsub) = sys.version_info
if (ver_major < 2) or ((ver_major == 2) and (ver_minor < 4)):
@ -39,7 +35,7 @@ class CryptoBoxContainer:
__fsTypes = {
"plain":["ext3", "ext2", "vfat", "reiser"],
"swap":["swap"]}
"TODO: mehr Dateisystemtypen? / 'reiser' pruefen"
# TODO: more filesystem types? / check 'reiser'
__dmDir = "/dev/mapper"
@ -57,7 +53,6 @@ class CryptoBoxContainer:
def setName(self, new_name):
"TODO: den Test-Code pruefen"
if new_name == self.name: return
if self.isMounted():
raise "VolumeIsActive", "the container must be inactive during renaming"
@ -148,6 +143,7 @@ class CryptoBoxContainer:
errorMsg = "Could not add a new luks key: %s - %s" % (output.strip(), errout.strip(), )
self.log.error(errorMsg)
raise "ChangePasswordError", errorMsg
## retrieve the key slot we used for unlocking
keys_found = re.search(r'key slot (\d{1,3}) unlocked', output).groups()
if keys_found:
keyslot = int(keys_found[0])