Example #1
0
    def __init__(self):
        super().__init__()

        self._firewall_module = FirewallModule()

        self.hostname_changed = Signal()
        self._hostname = ""

        self.current_hostname_changed = Signal()
        self._hostname_service_proxy = self._get_hostname_proxy()

        self.connected_changed = Signal()
        self.nm_client = None
        # TODO fallback solution - use Gio/GNetworkMonitor ?
        if SystemBus.check_connection():
            nm_client = NM.Client.new(None)
            if nm_client.get_nm_running():
                self.nm_client = nm_client
                self.nm_client.connect("notify::%s" % NM.CLIENT_STATE,
                                       self._nm_state_changed)
                initial_state = self.nm_client.get_state()
                self.set_connected(self._nm_state_connected(initial_state))
            else:
                log.debug("NetworkManager is not running.")

        self._original_network_data = []
        self._device_configurations = None
        self._use_device_configurations = False
        self.configurations_changed = Signal()

        self._default_device_specification = DEFAULT_DEVICE_SPECIFICATION
        self._bootif = None
        self._ifname_option_values = []
        self._disable_ipv6 = False
        self._apply_boot_options(kernel_arguments)
Example #2
0
    def __init__(self):
        self._localed_proxy = None

        if not conf.system.provides_system_bus:
            log.debug("Not using localed service: "
                      "system does not provide system bus according to configuration.")
            return

        if not SystemBus.check_connection():
            log.debug("Not using localed service: "
                      "system bus connection check failed.")
            return

        self._localed_proxy = LOCALED.get_proxy()