plugin volume_details shows filesystem
This commit is contained in:
parent
49e6e9d569
commit
ba0c164e94
4 changed files with 33 additions and 0 deletions
|
@ -18,5 +18,6 @@ Text {
|
||||||
Avail = Available space of volume
|
Avail = Available space of volume
|
||||||
Used = Used space of volume
|
Used = Used space of volume
|
||||||
}
|
}
|
||||||
|
Filesystem = Filesystem
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><?cs var:html_escape(Lang.Text.ContainerName) ?>: <?cs var:html_escape(Data.CurrentDisk.name) ?></li>
|
<li><?cs var:html_escape(Lang.Text.ContainerName) ?>: <?cs var:html_escape(Data.CurrentDisk.name) ?></li>
|
||||||
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.DeviceName) ?>: <?cs var:html_escape(Data.CurrentDisk.device) ?></li>
|
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.DeviceName) ?>: <?cs var:html_escape(Data.CurrentDisk.device) ?></li>
|
||||||
|
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.Filesystem) ?>: <?cs var:html_escape(Data.CurrentDisk.fs_type) ?></li>
|
||||||
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.Status) ?>: <?cs if:Data.CurrentDisk.active ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.StatusActive) ?><?cs else ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.StatusPassive) ?><?cs /if ?></li>
|
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.Status) ?>: <?cs if:Data.CurrentDisk.active ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.StatusActive) ?><?cs else ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.StatusPassive) ?><?cs /if ?></li>
|
||||||
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.EncryptionStatus) ?>: <?cs if:Data.CurrentDisk.encryption ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.Yes) ?><?cs else ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.No) ?><?cs /if ?></li>
|
<li><?cs var:html_escape(Lang.Plugins.volume_details.Text.EncryptionStatus) ?>: <?cs if:Data.CurrentDisk.encryption ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.Yes) ?><?cs else ?><?cs var:html_escape(Lang.Plugins.volume_details.Text.No) ?><?cs /if ?></li>
|
||||||
<?cs if:Data.CurrentDisk.active ?>
|
<?cs if:Data.CurrentDisk.active ?>
|
||||||
|
|
|
@ -60,6 +60,7 @@ class CryptoBoxContainer:
|
||||||
self.uuid = None
|
self.uuid = None
|
||||||
self.name = None
|
self.name = None
|
||||||
self.cont_type = None
|
self.cont_type = None
|
||||||
|
self.fs_type = None
|
||||||
self.mount = None
|
self.mount = None
|
||||||
self.umount = None
|
self.umount = None
|
||||||
self.attributes = None
|
self.attributes = None
|
||||||
|
@ -159,6 +160,14 @@ class CryptoBoxContainer:
|
||||||
return self.cont_type
|
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):
|
def is_mounted(self):
|
||||||
"""Check if the container is currently mounted.
|
"""Check if the container is currently mounted.
|
||||||
|
|
||||||
|
@ -201,6 +210,7 @@ class CryptoBoxContainer:
|
||||||
"""
|
"""
|
||||||
self.uuid = self.__get_uuid()
|
self.uuid = self.__get_uuid()
|
||||||
self.cont_type = self.__get_type_of_partition()
|
self.cont_type = self.__get_type_of_partition()
|
||||||
|
self.fs_type = self.__get_fs_type()
|
||||||
self.name = self.__get_name_of_container()
|
self.name = self.__get_name_of_container()
|
||||||
self.__set_attributes()
|
self.__set_attributes()
|
||||||
if self.cont_type == CONTAINERTYPES["luks"]:
|
if self.cont_type == CONTAINERTYPES["luks"]:
|
||||||
|
@ -441,6 +451,26 @@ class CryptoBoxContainer:
|
||||||
return None
|
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):
|
def __is_luks_partition(self):
|
||||||
"check if the given device is a luks partition"
|
"check if the given device is a luks partition"
|
||||||
proc = subprocess.Popen(
|
proc = subprocess.Popen(
|
||||||
|
|
|
@ -137,6 +137,7 @@ class WebInterfaceDataset(dict):
|
||||||
is_busy = container.is_busy() and 1 or 0
|
is_busy = container.is_busy() and 1 or 0
|
||||||
self["Data.CurrentDisk.device"] = container.get_device()
|
self["Data.CurrentDisk.device"] = container.get_device()
|
||||||
self["Data.CurrentDisk.name"] = container.get_name()
|
self["Data.CurrentDisk.name"] = container.get_name()
|
||||||
|
self["Data.CurrentDisk.fs_type"] = container.get_fs_type()
|
||||||
self["Data.CurrentDisk.encryption"] = is_encrypted
|
self["Data.CurrentDisk.encryption"] = is_encrypted
|
||||||
self["Data.CurrentDisk.plaintext"] = is_plain
|
self["Data.CurrentDisk.plaintext"] = is_plain
|
||||||
self["Data.CurrentDisk.active"] = is_mounted
|
self["Data.CurrentDisk.active"] = is_mounted
|
||||||
|
|
Loading…
Reference in a new issue