Beispiel #1
0
 def setNetworkOnbootDefault(self, ksdata):
     if any(nd.onboot for nd in ksdata.network.network if nd.device):
         return
     # choose the device used during installation
     # (ie for majority of cases the one having the default route)
     dev = network.default_route_device() or network.default_route_device(family="inet6")
     if not dev:
         return
     # ignore wireless (its ifcfgs would need to be handled differently)
     if nm.nm_device_type_is_wifi(dev):
         return
     network.update_onboot_value(dev, True, ksdata=ksdata)
Beispiel #2
0
 def setNetworkOnbootDefault(self, ksdata):
     if any(nd.onboot for nd in ksdata.network.network if nd.device):
         return
     # choose the device used during installation
     # (ie for majority of cases the one having the default route)
     dev = network.default_route_device() or network.default_route_device(family="inet6")
     if not dev:
         return
     # ignore wireless (its ifcfgs would need to be handled differently)
     if nm.nm_device_type_is_wifi(dev):
         return
     network.update_onboot_value(dev, True, ksdata=ksdata)
Beispiel #3
0
 def setNetworkOnbootDefault(self, ksdata):
     if network.has_some_wired_autoconnect_device():
         return
     # choose the device used during installation
     # (ie for majority of cases the one having the default route)
     dev = network.default_route_device() \
           or network.default_route_device(family="inet6")
     if not dev:
         return
     # ignore wireless (its ifcfgs would need to be handled differently)
     if nm.nm_device_type_is_wifi(dev):
         return
     network.update_onboot_value(dev, "yes", ksdata)
Beispiel #4
0
 def setNetworkOnbootDefault(self, ksdata):
     if network.has_some_wired_autoconnect_device():
         return
     # choose the device used during installation
     # (ie for majority of cases the one having the default route)
     dev = network.default_route_device() \
           or network.default_route_device(family="inet6")
     if not dev:
         return
     # ignore wireless (its ifcfgs would need to be handled differently)
     if nm.nm_device_type_is_wifi(dev):
         return
     network.update_onboot_value(dev, "yes", ksdata)
Beispiel #5
0
    def refresh(self):
        """
        The refresh method that is called every time the spoke is displayed.
        It should update the UI elements according to the contents of
        self.data.

        :see: pyanaconda.ui.common.UIObject.refresh

        """
        ## Every time we enter, make a list of all the devices that
        # are not the public interface (user might have changed this)
        pubif = network.default_route_device()
        allifs = filter(lambda x: nm.nm_device_type_is_ethernet(x),\
                nm.nm_devices())
        privates = filter(lambda x: x != pubif,allifs)
        idx = self.ifaceCombo.get_active()
        self.deviceStore.clear()
        for x in privates:
            entry=[None,None,None,None]
            entry[DEVICEIDX] = x
            entry[TYPEIDX] = "ethernet"
            entry[MACIDX] = nm.nm_device_perm_hwaddress(x)
            entry[LABELIDX] = "%s;%s" % (x,entry[MACIDX])
            self.deviceStore.append(entry)
        if len(privates) == 0:
            entry=[None,None,None,None]
            entry[DEVICEIDX] = "%s:0" % pubif
            entry[LABELIDX] = "%s;virtual interface" % entry[DEVICEIDX] 
            entry[TYPEIDX] = "virtual"
            entry[MACIDX] = ""
            self.deviceStore.append(entry)

        # Set the active entry, even if we reodered 
        self.ifaceCombo.set_active(idx)
Beispiel #6
0
    def ready(self):
        """
        The ready property that tells whether the spoke is ready (can be visited)
        or not. The spoke is made (in)sensitive based on the returned value.

        :rtype: bool

        """
        ## Let's see if we have a network default route set
        try:
            device = network.default_route_device()
            if device is None:
                self.readyState = False
                return False
        except:
            self.readyState = False
            return False

        # When we change from not ready to ready, send a HubQ message
        if self.readyState is False:
            self.readyState = True
            hubQ.send_ready(self.__class__.__name__, True)

        self.log.info("rocks_info.py:ready")
        return True
Beispiel #7
0
    def setNetworkOnbootDefault(self, ksdata):
        # if there is no device to be autoactivated after reboot
        for devName in nm.nm_devices():
            if nm.nm_device_type_is_wifi(devName):
                continue
            try:
                onboot = nm.nm_device_setting_value(devName, "connection",
                                                    "autoconnect")
            except nm.SettingsNotFoundError:
                continue
            if not onboot == False:
                return

        # set ONBOOT=yes for the device used during installation
        # (ie for majority of cases the one having the default route)
        devName = network.default_route_device()
        if not devName:
            return
        if nm.nm_device_type_is_wifi(devName):
            return
        ifcfg_path = network.find_ifcfg_file_of_device(devName,
                                                       root_path=ROOT_PATH)
        if not ifcfg_path:
            return
        ifcfg = network.IfcfgFile(ifcfg_path)
        ifcfg.read()
        ifcfg.set(('ONBOOT', 'yes'))
        ifcfg.write()
        for nd in ksdata.network.network:
            if nd.device == devName:
                nd.onboot = True
                break
Beispiel #8
0
    def refresh(self):
        """
        The refresh method that is called every time the spoke is displayed.
        It should update the UI elements according to the contents of
        self.data.

        :see: pyanaconda.ui.common.UIObject.refresh

        """
        ## Every time we enter, make a list of all the devices that
        # are not the public interface (user might have changed this)
        pubif = network.default_route_device()
        allifs = filter(lambda x: nm.nm_device_type_is_ethernet(x),\
                nm.nm_devices())
        privates = filter(lambda x: x != pubif,allifs)
        idx = self.ifaceCombo.get_active()
        self.deviceStore.clear()
        for x in privates:
            entry=[None,None,None,None]
            entry[DEVICEIDX] = x
            entry[TYPEIDX] = "ethernet"
            entry[MACIDX] = nm.nm_device_valid_hwaddress(x)
            entry[LABELIDX] = "%s;%s" % (x,entry[MACIDX])
            self.deviceStore.append(entry)
        if len(privates) == 0:
            entry=[None,None,None,None]
            entry[DEVICEIDX] = "%s:0" % pubif
            entry[LABELIDX] = "%s;virtual interface" % entry[DEVICEIDX] 
            entry[TYPEIDX] = "virtual"
            entry[MACIDX] = ""
            self.deviceStore.append(entry)

        # Set the active entry, even if we reodered 
        self.ifaceCombo.set_active(idx)
Beispiel #9
0
 def setNetworkOnbootDefault(self, ksdata):
     if ksdata.method.method not in ("url", "nfs"):
         return
     if network.has_some_wired_autoconnect_device():
         return
     dev = network.default_route_device()
     if not dev:
         return
     if nm.nm_device_type_is_wifi(dev):
         return
     network.update_onboot_value(dev, "yes", ksdata)