コード例 #1
0
ファイル: iscsi.py プロジェクト: VladimirSlavik/anaconda
    def _get_login_credentials(self, style):
        """Get credentials for the login.

        The current page from the loginAuthNotebook defines how to grab credentials
        out of the UI. This works as long as loginAuthNotebook keeps the filler page
        at the front, and we check to make sure "Use the credentials from discovery"
        is not selected first.

        :param style: an id of the login style
        :return: an instance of Credentials
        """
        # No credentials.
        credentials = Credentials()

        # CHAP
        if style is STYLE_CHAP:
            credentials.username = self._get_text("loginChapUsernameEntry")
            credentials.password = self._get_text("loginChapPasswordEntry")

        # Reverse CHAP.
        if style is STYLE_REVERSE_CHAP:
            credentials.username = self._get_text("loginRchapUsernameEntry")
            credentials.password = self._get_text("loginRchapPasswordEntry")
            credentials.reverse_username = self._get_text("loginRchapReverseUsername")
            credentials.reverse_password = self._get_text("loginRchapReversePassword")

        return credentials
コード例 #2
0
ファイル: iscsi.py プロジェクト: VladimirSlavik/anaconda
    def _get_discover_credentials(self, style):
        """Get credentials for the discovery.

        The current page from the authNotebook defines how to grab credentials
        out of the UI. This works as long as authNotebook keeps the filler page
        at the front.

        :param style: an id of the discovery style
        :return: an instance of Credentials
        """
        # No credentials.
        credentials = Credentials()

        # CHAP
        if style is STYLE_CHAP:
            credentials.username = self._get_text("chapUsernameEntry")
            credentials.password = self._get_text("chapPasswordEntry")

        # Reverse CHAP.
        if style is STYLE_REVERSE_CHAP:
            credentials.username = self._get_text("rchapUsernameEntry")
            credentials.password = self._get_text("rchapPasswordEntry")
            credentials.reverse_username = self._get_text("rchapReverseUsername")
            credentials.reverse_password = self._get_text("rchapReversePassword")

        return credentials