コード例 #1
0
    def prompt_for_bridge(self):
        # TODO prompt user to ask about bridging maas nw interface
        self.should_bridge_maasnw = True
        self.display_controller.info_message("Configuring MAAS Network")

        if self.should_bridge_maasnw:
            log.debug("bridging maas network")
            self.configure_nat(get_network('br0'))
            log.debug("configured NAT")
            self.enable_ipv4_forwarding()
            log.debug("enabled forwarding")
            self.gateway = get_ip_addr('br0')
            # excludes = [self.iface_ip]
        else:
            self.gateway = get_default_gateway()
            # excludes = [self.iface_ip, self.gateway]

        # excludes = list(map(ip_address, excludes))
        # nw = ip_network(self.iface_network, strict=False)
        # self.dhcp_range = ip_range_max(nw, excludes)

        self.display_controller.info_message(
            "Detecting Existing DHCP server")
        self.start_task("Searching for existing DHCP servers")
        # TODO Handle existing dhcp with another dialog or user interaction
        # to accept the consequences.
        if self.detect_existing_dhcp(self.target_iface):
            log.error(
                "An existing DHCP server was found on this interface, "
                "the network may be incorrectly configured.")
            pass
コード例 #2
0
    def prompt_for_bridge(self):
        # TODO prompt user to ask about bridging maas nw interface
        self.should_bridge_maasnw = True
        self.display_controller.status_info_message("Configuring MAAS Network")

        if self.should_bridge_maasnw:
            log.debug("bridging maas network")
            self.configure_nat(get_network('br0'))
            log.debug("configured NAT")
            self.enable_ipv4_forwarding()
            log.debug("enabled forwarding")
            self.gateway = get_ip_addr('br0')
            # excludes = [self.iface_ip]
        else:
            self.gateway = get_default_gateway()
            # excludes = [self.iface_ip, self.gateway]

        # excludes = list(map(ip_address, excludes))
        # nw = ip_network(self.iface_network, strict=False)
        # self.dhcp_range = ip_range_max(nw, excludes)

        self.display_controller.status_info_message(
            "Detecting Existing DHCP server")
        self.tasker.start_task("Searching for existing DHCP servers")
        # TODO Handle existing dhcp with another dialog or user interaction
        # to accept the consequences.
        if self.detect_existing_dhcp(self.target_iface):
            log.error("An existing DHCP server was found on this interface, "
                      "the network may be incorrectly configured.")
            pass
コード例 #3
0
    def interface_choice_cb(self, choice):
        self.target_iface = choice
        self.iface_ip = get_ip_addr(self.target_iface)
        self.iface_network = get_network(self.target_iface)

        self.update_progress()
        self.continue_with_interface()
コード例 #4
0
    def interface_choice_cb(self, choice):
        self.target_iface = choice
        self.iface_ip = get_ip_addr(self.target_iface)
        self.iface_network = get_network(self.target_iface)

        self.prompt_for_dhcp_range()
コード例 #5
0
    def interface_choice_cb(self, choice):
        self.target_iface = choice
        self.iface_ip = get_ip_addr(self.target_iface)
        self.iface_network = get_network(self.target_iface)

        self.prompt_for_dhcp_range()