コード例 #1
0
    def _connect(self):
        logger.debug("connecting to endpoint")
        try:
            self.client = XCLIClient.connect_multiendpoint_ssl(
                self.user, self.password, self.endpoint)

        except xcli_errors.CredentialsError:
            raise controller_errors.CredentialsError(self.endpoint)
        except xcli_errors.XCLIError:
            raise controller_errors.CredentialsError(self.endpoint)
コード例 #2
0
    def _connect(self):
        try:
            self.client = RESTClient(
                service_address=self.service_address,
                user=self.user,
                password=self.password,
            )

            self.system_info = self.get_system_info()

            if parse(self.version) < parse(self.SUPPORTED_FROM_VERSION):
                raise array_errors.UnsupportedStorageVersionError(
                    self.version, self.SUPPORTED_FROM_VERSION)
        except (exceptions.ClientError, exceptions.Unauthorized) as e:
            # BE7A002D=Authentication has failed because the user name and
            # password combination that you have entered is not valid.
            if ERROR_CODE_INVALID_CREDENTIALS or KNOWN_ERROR_CODE_INVALID_CREDENTIALS in str(
                    e.message).upper():
                raise array_errors.CredentialsError(self.service_address)
            raise ConnectionError()
        except exceptions.ClientException as e:
            logger.error(
                'Failed to connect to DS8K array {}, reason is {}'.format(
                    self.service_address, e.details))
            raise ConnectionError()
コード例 #3
0
 def _connect(self):
     logger.debug("Connecting to SVC {0}".format(self.endpoint))
     try:
         self.client = connect(self.endpoint, username=self.user,
                               password=self.password)
     except (svc_errors.IncorrectCredentials,
             svc_errors.StorageArrayClientException):
         raise controller_errors.CredentialsError(self.endpoint)
コード例 #4
0
    def _connect(self):
        try:
            self.client = RESTClient(service_address=self.service_address,
                                     user=self.user,
                                     password=self.password,
                                     )

            self.system_info = self.get_system_info()

            if parse(self.version) < parse(self.SUPPORTED_FROM_VERSION):
                raise array_errors.UnsupportedStorageVersionError(
                    self.version, self.SUPPORTED_FROM_VERSION
                )
        except exceptions.ClientException as ex:
            error_message = str(ex.message).upper()
            if ERROR_CODE_INVALID_CREDENTIALS in error_message or KNOWN_ERROR_CODE_INVALID_CREDENTIALS in error_message:
                raise array_errors.CredentialsError(self.service_address)
            logger.error(
                'Failed to connect to DS8K array {}, reason is {}'.format(self.service_address, ex.details))
            raise ex