def _do_delete(self): jc = JailsConfiguration.objects.order_by("-id")[0] jaildir = "%s/%s" % (jc.jc_path, self.plugin_jail) pbi_path = os.path.join( jc.jc_path, self.plugin_jail, "usr/pbi", "%s-%s" % (self.plugin_name, platform.machine()) ) jail = None for j in Jls(): if j.hostname == self.plugin_jail: jail = j break if jail is None: raise MiddlewareError("The plugins jail is not running, start " "it before proceeding") notifier().umount_filesystems_within(pbi_path) p = pbi_delete(pbi=self.plugin_pbiname) res = p.run(jail=True, jid=jail.jid) if not res or res[0] != 0: log.warn("unable to delete %s", self.plugin_pbiname)
def _do_delete(self): jc = JailsConfiguration.objects.order_by('-id')[0] pbi_path = os.path.join( jc.jc_path, self.plugin_jail, "usr/pbi", "%s-%s" % (self.plugin_name, platform.machine()), ) jail = None for j in Warden().getjails(): if j.host == self.plugin_jail: jail = j break if jail is None: raise MiddlewareError(_("jail not found")) notifier().umount_filesystems_within(pbi_path) p = pbi_delete(pbi=self.plugin_pbiname) res = p.run_in_chroot(os.path.join(jc.jc_path, jail.host)) if not res or res[0] != 0: log.warn("unable to delete %s", self.plugin_pbiname)
def _do_delete(self): jc = JailsConfiguration.objects.order_by('-id')[0] jaildir = "%s/%s" % (jc.jc_path, self.plugin_jail) pbi_path = os.path.join( jc.jc_path, self.plugin_jail, "usr/pbi", "%s-%s" % (self.plugin_name, platform.machine()), ) jail = None for j in Jls(): if j.hostname == self.plugin_jail: jail = j break if jail is None: raise MiddlewareError( _("The plugins jail is not running, start it before proceeding" )) notifier().umount_filesystems_within(pbi_path) p = pbi_delete(pbi=self.plugin_pbiname) res = p.run(jail=True, jid=jail.jid) if not res or res[0] != 0: log.warn("unable to delete %s", self.plugin_pbiname)