Beispiel #1
0
    def delete_vim_auth(self, context, vim_id, auth):
        """Delete vim information

        Delete vim key stored in file system
        """
        LOG.debug('Attempting to delete key for vim id %s', vim_id)

        if auth.get('key_type') == 'barbican_key':
            try:
                keystone_conf = CONF.keystone_authtoken
                secret_uuid = auth['secret_uuid']
                keymgr_api = KEYMGR_API(keystone_conf.auth_url)
                keymgr_api.delete(context, secret_uuid)
                LOG.debug('VIM key deleted successfully for vim %s', vim_id)
            except Exception as ex:
                LOG.warning('VIM key deletion failed for vim %s due to %s',
                            vim_id, ex)
                raise
        else:
            key_file = os.path.join(CONF.vim_keys.openstack, vim_id)
            try:
                os.remove(key_file)
                LOG.debug('VIM key deleted successfully for vim %s', vim_id)
            except OSError:
                LOG.warning('VIM key deletion failed for vim %s', vim_id)
Beispiel #2
0
    def delete_vim_auth(self, vim_id, auth):
        """Delete kubernetes vim information

        Delete vim key stored in file system
        """
        if 'secret_uuid' in auth:
            # Delete secret id of barbican
            LOG.debug('Attempting to delete key for vim id %s',
                      vim_id)
            if auth.get('key_type') == 'barbican_key':
                try:
                    k_context = \
                        t_context.generate_tacker_service_context()
                    keystone_conf = CONF.keystone_authtoken
                    secret_uuid = auth['secret_uuid']
                    keymgr_api = KEYMGR_API(keystone_conf.auth_url)
                    keymgr_api.delete(k_context, secret_uuid)
                    LOG.debug('VIM key deleted successfully for vim %s',
                              vim_id)
                except Exception as exception:
                    LOG.warning('VIM key deletion failed for vim %s due to %s',
                                vim_id,
                                exception)
                    raise
            else:
                raise nfvo.VimEncryptKeyError(vim_id=vim_id)
Beispiel #3
0
    def delete_vim_auth(self, vim_id, auth):
        """Delete vim information

        Delete vim key stored in file system
        """
        LOG.debug('Attempting to delete key for vim id %s', vim_id)

        if auth.get('key_type') == 'barbican_key':
            try:
                k_context = t_context.generate_tacker_service_context()
                keystone_conf = CONF.keystone_authtoken
                secret_uuid = auth['secret_uuid']
                keymgr_api = KEYMGR_API(keystone_conf.auth_url)
                keymgr_api.delete(k_context, secret_uuid)
                LOG.debug('VIM key deleted successfully for vim %s',
                          vim_id)
            except Exception as ex:
                LOG.warning('VIM key deletion failed for vim %s due to %s',
                            vim_id,
                            ex)
                raise
        else:
            key_file = os.path.join(CONF.vim_keys.openstack, vim_id)
            try:
                os.remove(key_file)
                LOG.debug('VIM key deleted successfully for vim %s',
                          vim_id)
            except OSError:
                LOG.warning('VIM key deletion failed for vim %s',
                            vim_id)
Beispiel #4
0
    def delete_vim_auth(self, context, vim_id, auth):
        """Delete kubernetes vim information

        Delete vim key stored in file system
        """
        if 'secret_uuid' in auth:
            # Delete secret id of barbican
            LOG.debug('Attempting to delete key for vim id %s', vim_id)
            if auth.get('key_type') == 'barbican_key':
                try:
                    keystone_conf = CONF.keystone_authtoken
                    secret_uuid = auth['secret_uuid']
                    keymgr_api = KEYMGR_API(keystone_conf.auth_url)
                    keymgr_api.delete(context, secret_uuid)
                    LOG.debug('VIM key deleted successfully for vim %s',
                              vim_id)
                except Exception as exception:
                    LOG.warning('VIM key deletion failed for vim %s due to %s',
                                vim_id, exception)
                    raise
            else:
                raise nfvo.VimEncryptKeyError(vim_id=vim_id)