Remove all usage of six library

Convert all code to not require six library and instead
use python 3.x logic.

Change-Id: I0f7d623d58072bc3b7761a3c70832298cbc00de1
This commit is contained in:
jacky06 2020-05-06 23:59:45 +08:00
parent 8b9d3e87ee
commit a85b110a1d
5 changed files with 7 additions and 15 deletions

View File

@ -7,6 +7,5 @@ openstacksdk>=0.24.0 # Apache-2.0
oslo.config>=5.2.0 # Apache-2.0
oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
six>=1.10.0 # MIT
tempest>=17.1.0 # Apache-2.0
tenacity>=4.9.0 # Apache-2.0

View File

@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from six.moves.urllib import parse as urllib
import time
from urllib import parse as urllib
from oslo_serialization import jsonutils
from oslo_utils import timeutils

View File

@ -14,11 +14,11 @@
from oslo_serialization import jsonutils
from oslo_utils import timeutils
from six.moves.urllib import parse as urllib
from tempest import config
from tempest.lib.common import rest_client
from tempest.lib import exceptions
import time
from urllib import parse as urllib
CONF = config.CONF

View File

@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from tempest.lib import decorators
from tempest.lib import exceptions
@ -128,17 +127,12 @@ class TestClusterPolicyAttachNegativePolicyNotFound(base.BaseSenlinAPITest):
'clusters', self.cluster_id, params)
message = ex.resp_body['error']['message']
if six.PY2:
if 'required' in str(message):
self.assertEqual("'policy_id' is a required property",
str(message))
else:
self.assertIn("Additional properties are not allowed",
str(message))
else:
# Python3 performs validation in unpredictable orders
if 'required' in str(message):
self.assertEqual("'policy_id' is a required property",
str(message))
else:
self.assertIn("Additional properties are not allowed",
str(message))
class TestClusterPolicyAttachNegativeNotFound(base.BaseSenlinAPITest):

View File

@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
@ -68,7 +67,7 @@ class TestNovaServerCluster(base.BaseSenlinIntegrationNonAdminTest):
metadata = {
'cluster_id': cluster['id'],
'cluster_node_id': node['id'],
'cluster_node_index': six.text_type(node['index'])
'cluster_node_index': str(node['index'])
}
self.assertEqual(metadata, node['details']['metadata'])
finally: