Esempio n. 1
0
    def ucs_manager_connect(self, ucsm_ip):
        """Connects to a UCS Manager."""
        if not self.ucsmsdk:
            self.ucsmsdk = self._import_ucsmsdk()

        credentials = self.ucsm_conf.get_credentials_for_ucsm_ip(ucsm_ip)
        handle = self.ucsmsdk.UcsHandle()
        try:
            handle.Login(ucsm_ip, credentials[1], credentials[0])
        except Exception as e:
            # Raise a Neutron exception. Include a description of
            # the original  exception.
            raise cexc.UcsmConnectFailed(ucsm_ip=ucsm_ip, exc=e)

        return handle
    def ucs_manager_connect(self):
        """Connects to a UCS Manager."""
        self._validate_config()

        if not self.ucsmsdk:
            self.ucsmsdk = self._import_ucsmsdk()

        handle = self.ucsmsdk.UcsHandle()
        try:
            handle.Login(self.ucsm_ip, self.username, self.password)
        except Exception as e:
            # Raise a Neutron exception. Include a description of
            # the original  exception.
            raise cexc.UcsmConnectFailed(ucsm_ip=self.ucsm_ip, exc=e)

        return handle
Esempio n. 3
0
    def ucs_manager_connect(self, ucsm_ip):
        """Connects to a UCS Manager."""
        if not self.ucsmsdk:
            self.ucsmsdk = self._import_ucsmsdk()

        credentials = self.ucsm_conf.get_credentials_for_ucsm_ip(ucsm_ip)
        if not credentials:
            LOG.error(
                _LE('UCS Manager network driver failed to get login '
                    'credentials for UCSM %s'), ucsm_ip)
            return None

        handle = self.ucsmsdk.UcsHandle()
        try:
            handle.Login(ucsm_ip, credentials[1], credentials[0])
        except Exception as e:
            # Raise a Neutron exception. Include a description of
            # the original  exception.
            raise cexc.UcsmConnectFailed(ucsm_ip=ucsm_ip, exc=e)

        return handle
    def ucs_manager_connect(self, ucsm_ip):
        """Connects to a UCS Manager."""
        if not self.ucsmsdk:
            self.ucsmsdk = self._import_ucsmsdk()

        username, password = self.ucsm_conf.get_credentials_for_ucsm_ip(
            ucsm_ip)
        if not username:
            LOG.error(
                'UCS Manager network driver failed to get login '
                'credentials for UCSM %s', ucsm_ip)
            return None

        handle = self.ucsmsdk.handle(ucsm_ip, username, password)
        try:
            handle.login()
        except Exception as e:
            # Raise a Neutron exception. Include a description of
            # the original  exception.
            raise cexc.UcsmConnectFailed(ucsm_ip=ucsm_ip, exc=e)

        return handle