self.id = fscid
self.getinfo(refresh = True)
+ # Stash a reference to the first created filesystem on ctx, so
+ # that if someone drops to the interactive shell they can easily
+ # poke our methods.
+ if not hasattr(self._ctx, "filesystem"):
+ self._ctx.filesystem = self
+
def getinfo(self, refresh = False):
status = self.status()
if self.id is not None:
self.getinfo(refresh = True)
+ def __del__(self):
+ if getattr(self._ctx, "filesystem", None) == self:
+ delattr(self._ctx, "filesystem")
+
def exists(self):
"""
Whether a filesystem exists in the mon's filesystem list
self.id = fscid
self.getinfo(refresh=True)
+ # Stash a reference to the first created filesystem on ctx, so
+ # that if someone drops to the interactive shell they can easily
+ # poke our methods.
+ if not hasattr(self._ctx, "filesystem"):
+ self._ctx.filesystem = self
+
@property
def _prefix(self):
return BIN_PREFIX