Merge "Remove six from Veritas drivers"

This commit is contained in:
Zuul 2024-02-16 18:32:54 +00:00 committed by Gerrit Code Review
commit ad8c3cdfc8

View File

@ -16,6 +16,7 @@ Veritas Access Driver for ISCSI.
""" """
import ast import ast
from http import HTTPStatus
import json import json
from random import randint from random import randint
from xml.dom import minidom from xml.dom import minidom
@ -29,7 +30,6 @@ from oslo_utils import strutils
from oslo_utils import units from oslo_utils import units
import requests import requests
import requests.auth import requests.auth
from six.moves import http_client
from cinder.common import constants from cinder.common import constants
from cinder import exception from cinder import exception
@ -820,7 +820,7 @@ class ACCESSIscsiDriver(driver.ISCSIDriver):
self._user, self._pwd) self._user, self._pwd)
response = self.session.request(method, full_url, **kwargs) response = self.session.request(method, full_url, **kwargs)
if response.status_code != http_client.OK: if response.status_code != HTTPStatus.OK:
LOG.error('Access API operation failed with HTTP error code %s.', LOG.error('Access API operation failed with HTTP error code %s.',
str(response.status_code)) str(response.status_code))
return False return False
@ -837,7 +837,7 @@ class ACCESSIscsiDriver(driver.ISCSIDriver):
% (address, self._port), % (address, self._port),
data={'username': username, data={'username': username,
'password': password}) 'password': password})
if response.status_code != http_client.OK: if response.status_code != HTTPStatus.OK:
LOG.error('Failed to authenticate to remote cluster at %s as %s.', LOG.error('Failed to authenticate to remote cluster at %s as %s.',
address, username) address, username)
raise exception.NotAuthorized(_('Authentication failure.')) raise exception.NotAuthorized(_('Authentication failure.'))