diff --git a/src/cryptobox/core/main.py b/src/cryptobox/core/main.py index 5a78d1a..fef1d34 100644 --- a/src/cryptobox/core/main.py +++ b/src/cryptobox/core/main.py @@ -145,7 +145,7 @@ class CryptoBox: + "appropriate line to '/etc/super.tab'?") - def reread_container_list(self): + def reread_container_list(self, reset_device=None): """Reinitialize the list of available containers. This should be called whenever the available containers may have changed. @@ -153,7 +153,10 @@ class CryptoBox: """ self.log.debug("rereading container list") self.__containers = [] - blockdevice.CACHE.reset() + if reset_device is None: + blockdevice.CACHE.reset() + else: + blockdevice.CACHE.reset(reset_device) for device in blockdevice.Blockdevices().get_storage_devices(): if self.is_device_allowed(device) and not self.is_config_partition(device): self.__containers.append(cbxContainer.CryptoBoxContainer(device, self)) diff --git a/src/cryptobox/web/dataset.py b/src/cryptobox/web/dataset.py index d89f4ec..3e438f0 100644 --- a/src/cryptobox/web/dataset.py +++ b/src/cryptobox/web/dataset.py @@ -171,7 +171,6 @@ class WebInterfaceDataset(dict): del self[key] avail_counter = 0 active_counter = 0 - self.cbox.reread_container_list() for container in self.cbox.get_container_list(): ## useful if the container was changed during an action container.reset_object() diff --git a/src/cryptobox/web/sites.py b/src/cryptobox/web/sites.py index 2787771..d236c4e 100644 --- a/src/cryptobox/web/sites.py +++ b/src/cryptobox/web/sites.py @@ -354,6 +354,8 @@ class WebInterfaceSites: ## additionally: set the default template for plugins if "volume" in plugin.plugin_capabilities: ## maybe the state of the current volume was changed? + cryptobox.core.blockdevice.CACHE.reset(plugin.device) + plugin.device.reset() self.__dataset.set_current_disk_state(plugin.device) if not next_template: next_template = { "plugin":"volume_mount",