def on_merge(self, effective_changes):
        self.logger.debug("Saving remote storage page")
        changes = Changeset(self.pending_changes(False))
        effective_model = Changeset(self.model())
        effective_model.update(effective_changes)

        self.logger.debug("Changes: %s" % changes)
        self.logger.debug("Effective Model: %s" % effective_model)

        txs = utils.Transaction(_("Updating remote storage configuration"))

        iscsi_keys = ["iscsi.initiator_name"]
        if changes.contains_any(iscsi_keys):
            model = defaults.iSCSI()
            args = effective_model.values_for(iscsi_keys)
            args += [None, None, None]  # No target config
            model.update(*args)
            txs += model.transaction()

        nfsv4_keys = ["nfsv4.domain"]
        if changes.contains_any(nfsv4_keys):
            model = defaults.NFSv4()
            args = effective_model.values_for(nfsv4_keys)
            model.update(*args)
            txs += model.transaction()

        scsi_keys = ["scsi.dh_alua"]
        if changes.contains_any(scsi_keys):
            model = defaults.SCSIDhAlua()
            args = effective_model.values_for(scsi_keys)
            model.update(*args)
            txs += model.transaction()

        progress_dialog = ui.TransactionProgressDialog("dialog.txs", txs, self)
        progress_dialog.run()
    def on_merge(self, effective_changes):
        self.logger.debug("Saving remote storage page")
        changes = Changeset(self.pending_changes(False))
        effective_model = Changeset(self.model())
        effective_model.update(effective_changes)

        self.logger.debug("Changes: %s" % changes)
        self.logger.debug("Effective Model: %s" % effective_model)

        txs = utils.Transaction("Updating remote storage configuration")

        iscsi_keys = ["iscsi.initiator_name"]
        if changes.contains_any(iscsi_keys):
            model = defaults.iSCSI()
            args = effective_model.values_for(iscsi_keys)
            args += [None, None, None]  # No target config
            model.update(*args)
            txs += model.transaction()

        nfsv4_keys = ["nfsv4.domain"]
        if changes.contains_any(nfsv4_keys):
            model = defaults.NFSv4()
            args = effective_model.values_for(nfsv4_keys)
            model.update(*args)
            txs += model.transaction()

        progress_dialog = ui.TransactionProgressDialog("dialog.txs", txs, self)
        progress_dialog.run()
 def model(self):
     icfg = defaults.iSCSI().retrieve()
     ncfg = defaults.NFSv4().retrieve()
     model = {}
     model["iscsi.initiator_name"] = icfg["name"] or \
         storage.iSCSI().initiator_name()
     model["nfsv4.domain"] = ncfg["domain"]
     return model
 def model(self):
     icfg = defaults.iSCSI().retrieve()
     #ncfg = defaults.NFSv4().retrieve()
     model = {}
     model["iscsi.initiator_name"] = icfg["name"] or ""
     #model["iscsi.initiator_name"] = ""
     #model["nfsv4.domain"] = ncfg["domain"]
     return model
 def model(self):
     icfg = defaults.iSCSI().retrieve()
     ncfg = defaults.NFSv4().retrieve()
     model = {}
     model["iscsi.initiator_name"] = icfg["name"] or \
         self.dry_or(lambda: storage.iSCSI().initiator_name())
     model["nfsv4.domain"] = ncfg["domain"]
     return model
 def model(self):
     icfg = defaults.iSCSI().retrieve()
     ncfg = defaults.NFSv4().retrieve()
     boot = defaults.SCSIDhAlua().retrieve()
     model = {}
     model["iscsi.initiator_name"] = icfg["name"] or \
         self.dry_or(lambda: storage.iSCSI().initiator_name())
     model["scsi.dh_alua"] = boot["enabled"] or False
     model["nfsv4.domain"] = ncfg["domain"]
     return model
 def model(self):
     icfg = defaults.iSCSI().retrieve()
     ncfg = defaults.NFSv4().retrieve()
     boot = defaults.SCSIDhAlua().retrieve()
     model = {}
     model["iscsi.initiator_name"] = icfg["name"] or \
         self.dry_or(lambda: storage.iSCSI().initiator_name())
     model["scsi.dh_alua"] = boot["enabled"] or False
     model["nfsv4.domain"] = ncfg["domain"]
     return model