Exemplo n.º 1
0
    def __init__(self, net, parent=None, accept_empty=False):
        AbstractIPListEdit.__init__(self, parent, accept_empty)

        if USE_HA_MODULE:
            ha_cfg = QHAObject.getInstance().hacfg
            if ha_cfg is None or ha_cfg.ha_type == ENOHA:
                self.service = ""
            else:
                self.service = " service"
        else:
            self.service = ""

        self.fill(net)
        self._nok_stylesheet = ''
Exemplo n.º 2
0
    def backend_values(self):
        init_qnetobject()
        serialized_ha_conf = {
            'DATASTRUCTURE_VERSION': 3,
            "ha_type": "PRIMARY",
            "interface_id": "eth0",
            #"interface_id": "268435455",
            "interface_name": "eth0",
            "primary_hostname": "primary",

        }
        QHAObject.getInstance().cfg = HAConf.deserialize(serialized_ha_conf)
        return {
        #('ha', "getState"): ['NOT_REGISTERED', 0, '']
        ('ha', "getState"): ['PRIMARY', 0, '']
    }
Exemplo n.º 3
0
    def _load(self):
        if not NuConfMainWindow.minimalMode:
            # before creation of frontends, initialize QNetObject, QHAObject
            serialized_net_conf = self.init_call('network', 'getNetconfig')
            if serialized_net_conf is not None:
                QNetObject.getInstance().netcfg = serialized_net_conf


            if not self.__has_ha():
                return
            try:
                serialized_ha_conf = self.init_call('ha', 'getConfig')
                if serialized_ha_conf is None:
                    return
                QHAObject.getInstance().hacfg = serialized_ha_conf
            except (RpcdError, DatastructureIncompatible):
                # ha backend is not available
                pass