Example #1
0
def addIscsiDrive(anaconda, bind=False):
    """
    Displays a series of dialogs that walk the user through discovering and
    logging into iscsi nodes.
    
    Returns gtk.RESPONSE_OK if at least one iscsi node has been logged into.
    """

    # make sure the network is up
    if not network.hasActiveNetDev():
        if not anaconda.intf.enableNetwork():
            log.info("addIscsiDrive(): early exit, network disabled.")
            return gtk.RESPONSE_CANCEL
        urlgrabber.grabber.reset_curl_obj()

    # This will modify behaviour of iscsi.discovery() function
    if storage.iscsi.iscsi().mode == "none" and not bind:
        storage.iscsi.iscsi().delete_interfaces()
    elif (storage.iscsi.iscsi().mode == "none" and bind) \
          or storage.iscsi.iscsi().mode == "bind":
        active = set(network.getActiveNetDevs())
        created = set(storage.iscsi.iscsi().ifaces.values())
        storage.iscsi.iscsi().create_interfaces(active - created)

    wizard = iSCSIGuiWizard()
    login_ok_nodes = pih.drive_iscsi_addition(anaconda, wizard)
    if len(login_ok_nodes):
        return gtk.RESPONSE_OK
    log.info("addIscsiDrive(): no new nodes added")
    return gtk.RESPONSE_CANCEL
Example #2
0
    def addIscsiDriveDialog(self, screen):
        if not network.hasActiveNetDev():
            ButtonChoiceWindow(
                screen, _("Error"), "Must have a network configuration set up "
                "for iSCSI config.  Please boot with "
                "'linux asknetwork'")
            log.info("addIscsiDriveDialog(): early exit, network disabled.")
            return INSTALL_BACK

        wizard = iSCSITextWizard(screen)
        login_ok_nodes = pih.drive_iscsi_addition(self.anaconda, wizard)
        if len(login_ok_nodes):
            return INSTALL_OK
        log.info("addIscsiDriveDialog(): no new nodes added")
        return INSTALL_BACK
Example #3
0
def addIscsiDrive(anaconda):
    """
    Displays a series of dialogs that walk the user through discovering and
    logging into iscsi nodes.
    
    Returns gtk.RESPONSE_OK if at least one iscsi node has been logged into.
    """

    # make sure the network is up
    if not network.hasActiveNetDev():
        if not anaconda.intf.enableNetwork():
            log.info("addIscsiDrive(): early exit, network disabled.")
            return gtk.RESPONSE_CANCEL
        urlgrabber.grabber.reset_curl_obj()

    wizard = iSCSIGuiWizard()
    login_ok_nodes = pih.drive_iscsi_addition(anaconda, wizard)
    if len(login_ok_nodes):
        return gtk.RESPONSE_OK
    log.info("addIscsiDrive(): no new nodes added")
    return gtk.RESPONSE_CANCEL
    def addIscsiDriveDialog(self, screen, bind=False):
        if not network.hasActiveNetDev():
            ButtonChoiceWindow(
                screen, _("Error"), "Must have a network configuration set up "
                "for iSCSI config.  Please boot with "
                "'linux asknetwork'")
            log.info("addIscsiDriveDialog(): early exit, network disabled.")
            return INSTALL_BACK

        # This will modify behaviour of iscsi.discovery() function
        if storage.iscsi.iscsi().mode == "none" and not bind:
            storage.iscsi.iscsi().delete_interfaces()
        elif (storage.iscsi.iscsi().mode == "none" and bind) \
              or storage.iscsi.iscsi().mode == "bind":
            active = set(network.getActiveNetDevs())
            created = set(storage.iscsi.iscsi().ifaces.values())
            storage.iscsi.iscsi().create_interfaces(active - created)

        wizard = iSCSITextWizard(screen)
        login_ok_nodes = pih.drive_iscsi_addition(self.anaconda, wizard)
        if len(login_ok_nodes):
            return INSTALL_OK
        log.info("addIscsiDriveDialog(): no new nodes added")
        return INSTALL_BACK
Example #5
0
    def addIscsiDriveDialog(self, screen, bind=False):
        if not network.hasActiveNetDev():
            ButtonChoiceWindow(screen, _("Error"),
                               "Must have a network configuration set up "
                               "for iSCSI config.  Please boot with "
                               "'linux asknetwork'")
            log.info("addIscsiDriveDialog(): early exit, network disabled.")
            return INSTALL_BACK

        # This will modify behaviour of iscsi.discovery() function
        if storage.iscsi.iscsi().mode == "none" and not bind:
            storage.iscsi.iscsi().delete_interfaces()
        elif (storage.iscsi.iscsi().mode == "none" and bind) \
              or storage.iscsi.iscsi().mode == "bind":
            active = set(network.getActiveNetDevs())
            created = set(storage.iscsi.iscsi().ifaces.values())
            storage.iscsi.iscsi().create_interfaces(active - created)

        wizard = iSCSITextWizard(screen)
        login_ok_nodes = pih.drive_iscsi_addition(self.anaconda, wizard)
        if len(login_ok_nodes):
            return INSTALL_OK
        log.info("addIscsiDriveDialog(): no new nodes added")
        return INSTALL_BACK