Beispiel #1
0
    def on_login_clicked(self, *args):
        """Start the login task."""
        row = self._find_row_for_login()

        # Skip, if there is nothing to do.
        if not row:
            return

        # First update widgets.
        self._set_login_sensitive(False)
        self._okButton.set_sensitive(False)
        self._cancelButton.set_sensitive(False)
        self._loginButton.set_sensitive(False)
        self._loginConditionNotebook.set_current_page(0)

        # Get data.
        portal = self._get_portal()
        node = self._find_node_for_row(row)
        _style, credentials = self._get_login_style_and_credentials()

        # Get the login task.
        task_path = self._iscsi_module.LoginWithTask(
            Portal.to_structure(portal),
            Credentials.to_structure(credentials),
            Node.to_structure(node)
        )
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the login.
        async_run_task(task_proxy, lambda task_proxy: self.process_login_result(task_proxy, row))

        self._loginSpinner.start()
        self._loginSpinner.show()
Beispiel #2
0
    def repopulate_storage(self):
        """Repopulate the storage."""
        # Update the widgets.
        self._conditionNotebook.set_current_page(PAGE_RESULT_SUCCESS)

        # Get the task.
        task_path = self._storage_proxy.ScanDevicesWithTask()
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the task.
        async_run_task(task_proxy, self.repopulate_finished)

        self._repopulateSpinner.start()
Beispiel #3
0
    def on_add_clicked(self, *args):
        """Start the discovery task."""
        # First update widgets.
        self._set_configure_sensitive(False)
        self._errorBox.hide()

        # Get the discovery task.
        task_path = self._fcoe_proxy.DiscoverWithTask(self.nic, self.use_dcb, self.use_auto_vlan)
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the discovery.
        async_run_task(task_proxy, self.process_result)

        self._spinner.start()
        self._spinner.show()
Beispiel #4
0
    def on_add_clicked(self, *args):
        """Start the discovery task."""
        # First update widgets.
        self._set_configure_sensitive(False)
        self._errorBox.hide()

        # Get the discovery task.
        task_path = self._fcoe_proxy.DiscoverWithTask(self.nic, self.use_dcb, self.use_auto_vlan)
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the discovery.
        async_run_task(task_proxy, self.process_result)

        self._spinner.start()
        self._spinner.show()
Beispiel #5
0
    def on_start_clicked(self, *args):
        """Start the discovery task."""
        # First update widgets.
        self._startButton.hide()
        self._cancelButton.set_sensitive(False)
        self._okButton.set_sensitive(False)
        self._conditionNotebook.set_current_page(1)
        self._set_configure_sensitive(False)
        self._initiatorEntry.set_sensitive(False)

        # Get the node discovery credentials.
        style = self._authNotebook.get_current_page()
        portal = self._get_portal()
        credentials = self._get_discover_credentials(style)
        initiator = self._get_text("initiatorEntry")

        self._discoveredLabel.set_markup(_(
            "The following nodes were discovered using the iSCSI initiator "
            "<b>%(initiatorName)s</b> using the portal IP address "
            "<b>%(portalAddress)s</b>.  Please select which nodes you "
            "wish to log into:") %
            {
                "initiatorName": escape_markup(initiator),
                "portalAddress": escape_markup(portal.ip_address)
            }
        )

        # Get the discovery task.
        if self._bindCheckbox.get_active():
            interfaces_mode = ISCSI_INTERFACE_IFACENAME
        else:
            interfaces_mode = ISCSI_INTERFACE_DEFAULT
        task_path = self._iscsi_module.DiscoverWithTask(
            Portal.to_structure(portal),
            Credentials.to_structure(credentials),
            interfaces_mode
        )
        task_proxy = STORAGE.get_proxy(task_path)

        if self._iscsi_module.CanSetInitiator():
            self._iscsi_module.Initiator = initiator

        # Start the discovery.
        async_run_task(task_proxy, self.process_discovery_result)

        self._discoverySpinner.start()
Beispiel #6
0
    def on_start_clicked(self, *args):
        """ Go through the process of validating entry contents and then
            attempt to add the device.
        """
        # First update widgets
        self._startButton.hide()
        self._okButton.set_sensitive(False)
        self._cancelButton.set_sensitive(False)
        self._deviceEntry.set_sensitive(False)
        self._conditionNotebook.set_current_page(1)

        # Get the device number.
        device_number = self._deviceEntry.get_text().strip()

        # Get the discovery task.
        task_path = self._dasd_proxy.DiscoverWithTask(device_number)
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the discovery.
        async_run_task(task_proxy, self.process_result)
        self._spinner.start()
Beispiel #7
0
    def reconfigure_namespace(self, namespace):
        """Start the reconfiguration task."""
        # Update the widgets.
        self._conditionNotebook.set_current_page(PAGE_ACTION)
        self._startButton.set_sensitive(False)
        self._cancelButton.set_sensitive(False)
        self._sectorSizeSpinButton.set_sensitive(False)
        self._okButton.set_sensitive(False)

        # Get the data.
        mode = NVDIMM_MODE_SECTOR
        sector_size = self.sector_size

        # Get the task.
        task_path = self._nvdimm_proxy.ReconfigureWithTask(namespace, mode, sector_size)
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the reconfiguration.
        async_run_task(task_proxy, self.reconfigure_finished)

        self._reconfigureSpinner.start()
Beispiel #8
0
    def reconfigure_namespace(self, namespace):
        """Start the reconfiguration task."""
        # Update the widgets.
        self._conditionNotebook.set_current_page(PAGE_ACTION)
        self._startButton.set_sensitive(False)
        self._cancelButton.set_sensitive(False)
        self._sectorSizeSpinButton.set_sensitive(False)
        self._okButton.set_sensitive(False)

        # Get the data.
        mode = NVDIMM_MODE_SECTOR
        sector_size = self.sector_size

        # Get the task.
        task_path = self._nvdimm_proxy.ReconfigureWithTask(namespace, mode, sector_size)
        task_proxy = STORAGE.get_proxy(task_path)

        # Start the reconfiguration.
        async_run_task(task_proxy, self.reconfigure_finished)

        self._reconfigureSpinner.start()
Beispiel #9
0
 def _async_run_test(self):
     async_run_task(self.task_interface, self._async_callback)
Beispiel #10
0
 def _async_run_test(self):
     async_run_task(self.task_interface, self._async_callback)