plugin volume_details shows filesystem
This commit is contained in:
parent
49e6e9d569
commit
ba0c164e94
4 changed files with 33 additions and 0 deletions
|
@ -60,6 +60,7 @@ class CryptoBoxContainer:
|
|||
self.uuid = None
|
||||
self.name = None
|
||||
self.cont_type = None
|
||||
self.fs_type = None
|
||||
self.mount = None
|
||||
self.umount = None
|
||||
self.attributes = None
|
||||
|
@ -159,6 +160,14 @@ class CryptoBoxContainer:
|
|||
return self.cont_type
|
||||
|
||||
|
||||
def get_fs_type(self):
|
||||
"""Return the filesystem type of this container.
|
||||
|
||||
Available since: 0.3.0
|
||||
"""
|
||||
return self.fs_type
|
||||
|
||||
|
||||
def is_mounted(self):
|
||||
"""Check if the container is currently mounted.
|
||||
|
||||
|
@ -201,6 +210,7 @@ class CryptoBoxContainer:
|
|||
"""
|
||||
self.uuid = self.__get_uuid()
|
||||
self.cont_type = self.__get_type_of_partition()
|
||||
self.fs_type = self.__get_fs_type()
|
||||
self.name = self.__get_name_of_container()
|
||||
self.__set_attributes()
|
||||
if self.cont_type == CONTAINERTYPES["luks"]:
|
||||
|
@ -441,6 +451,26 @@ class CryptoBoxContainer:
|
|||
return None
|
||||
|
||||
|
||||
def __get_fs_type(self):
|
||||
"returns the filesystem used on a container"
|
||||
#TODO: with a luks volume use the mapping instead of the device
|
||||
proc = subprocess.Popen(
|
||||
shell = False,
|
||||
stdout = subprocess.PIPE,
|
||||
stderr = subprocess.PIPE,
|
||||
args = [ self.cbox.prefs["Programs"]["blkid"],
|
||||
"-s","TYPE",
|
||||
self.device ])
|
||||
(stdout, stderr) = proc.communicate()
|
||||
if proc.returncode == 0:
|
||||
return stdout.split("TYPE=")[1]
|
||||
else:
|
||||
self.cbox.log.warn("filesystem determination failed: %s" % \
|
||||
(stderr.strip(), ))
|
||||
return "undetermined"
|
||||
return
|
||||
|
||||
|
||||
def __is_luks_partition(self):
|
||||
"check if the given device is a luks partition"
|
||||
proc = subprocess.Popen(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue