Merge "Remove six and python 2.7 full support"
This commit is contained in:
commit
c20124891e
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
import mock
|
import mock
|
||||||
from oslo_messaging.rpc import dispatcher
|
from oslo_messaging.rpc import dispatcher
|
||||||
import six
|
|
||||||
import webob
|
import webob
|
||||||
|
|
||||||
from heat.common import exception
|
from heat.common import exception
|
||||||
@ -1309,7 +1308,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
|
|
||||||
res = dict(self.engine.validate_template(self.ctx, t, {}))
|
res = dict(self.engine.validate_template(self.ctx, t, {}))
|
||||||
self.assertEqual({'Error': 'Resources must contain Resource. '
|
self.assertEqual({'Error': 'Resources must contain Resource. '
|
||||||
'Found a [%s] instead' % six.text_type},
|
'Found a [%s] instead' % str},
|
||||||
res)
|
res)
|
||||||
|
|
||||||
def test_invalid_section_cfn(self):
|
def test_invalid_section_cfn(self):
|
||||||
@ -1621,7 +1620,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
'parameter_groups.Database '
|
'parameter_groups.Database '
|
||||||
'Group: The InstanceType parameter must be '
|
'Group: The InstanceType parameter must be '
|
||||||
'assigned to one parameter group only.'),
|
'assigned to one parameter group only.'),
|
||||||
six.text_type(exc))
|
str(exc))
|
||||||
|
|
||||||
def test_validate_duplicate_parameters_no_label(self):
|
def test_validate_duplicate_parameters_no_label(self):
|
||||||
t = template_format.parse(test_template_parameters_duplicate_no_label)
|
t = template_format.parse(test_template_parameters_duplicate_no_label)
|
||||||
@ -1634,7 +1633,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
'parameter_groups.: '
|
'parameter_groups.: '
|
||||||
'The key_name parameter must be '
|
'The key_name parameter must be '
|
||||||
'assigned to one parameter group only.'),
|
'assigned to one parameter group only.'),
|
||||||
six.text_type(exc))
|
str(exc))
|
||||||
|
|
||||||
def test_validate_invalid_parameter_in_group(self):
|
def test_validate_invalid_parameter_in_group(self):
|
||||||
t = template_format.parse(test_template_invalid_parameter_name)
|
t = template_format.parse(test_template_invalid_parameter_name)
|
||||||
@ -1652,7 +1651,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
'parameter_groups.Database Group: The grouped '
|
'parameter_groups.Database Group: The grouped '
|
||||||
'parameter SomethingNotHere does not '
|
'parameter SomethingNotHere does not '
|
||||||
'reference a valid parameter.'),
|
'reference a valid parameter.'),
|
||||||
six.text_type(exc))
|
str(exc))
|
||||||
|
|
||||||
def test_validate_invalid_parameter_no_label(self):
|
def test_validate_invalid_parameter_no_label(self):
|
||||||
t = template_format.parse(test_template_invalid_parameter_no_label)
|
t = template_format.parse(test_template_invalid_parameter_no_label)
|
||||||
@ -1666,7 +1665,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
'parameter_groups.: The grouped '
|
'parameter_groups.: The grouped '
|
||||||
'parameter key_name does not '
|
'parameter key_name does not '
|
||||||
'reference a valid parameter.'),
|
'reference a valid parameter.'),
|
||||||
six.text_type(exc))
|
str(exc))
|
||||||
|
|
||||||
def test_validate_no_parameters_in_group(self):
|
def test_validate_no_parameters_in_group(self):
|
||||||
t = template_format.parse(test_template_no_parameters)
|
t = template_format.parse(test_template_no_parameters)
|
||||||
@ -1677,7 +1676,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
|
|
||||||
self.assertEqual(_('Parameter Groups error: parameter_groups.Server '
|
self.assertEqual(_('Parameter Groups error: parameter_groups.Server '
|
||||||
'Group: The parameters must be provided for each '
|
'Group: The parameters must be provided for each '
|
||||||
'parameter group.'), six.text_type(exc))
|
'parameter group.'), str(exc))
|
||||||
|
|
||||||
def test_validate_parameter_groups_not_list(self):
|
def test_validate_parameter_groups_not_list(self):
|
||||||
t = template_format.parse(test_template_parameter_groups_not_list)
|
t = template_format.parse(test_template_parameter_groups_not_list)
|
||||||
@ -1688,7 +1687,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
|
|
||||||
self.assertEqual(_('Parameter Groups error: parameter_groups: '
|
self.assertEqual(_('Parameter Groups error: parameter_groups: '
|
||||||
'The parameter_groups should be '
|
'The parameter_groups should be '
|
||||||
'a list.'), six.text_type(exc))
|
'a list.'), str(exc))
|
||||||
|
|
||||||
def test_validate_parameters_not_list(self):
|
def test_validate_parameters_not_list(self):
|
||||||
t = template_format.parse(test_template_parameters_not_list)
|
t = template_format.parse(test_template_parameters_not_list)
|
||||||
@ -1700,7 +1699,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
self.assertEqual(_('Parameter Groups error: '
|
self.assertEqual(_('Parameter Groups error: '
|
||||||
'parameter_groups.Server Group: '
|
'parameter_groups.Server Group: '
|
||||||
'The parameters of parameter group should be '
|
'The parameters of parameter group should be '
|
||||||
'a list.'), six.text_type(exc))
|
'a list.'), str(exc))
|
||||||
|
|
||||||
def test_validate_parameters_error_no_label(self):
|
def test_validate_parameters_error_no_label(self):
|
||||||
t = template_format.parse(test_template_parameters_error_no_label)
|
t = template_format.parse(test_template_parameters_error_no_label)
|
||||||
@ -1711,7 +1710,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
|
|
||||||
self.assertEqual(_('Parameter Groups error: parameter_groups.: '
|
self.assertEqual(_('Parameter Groups error: parameter_groups.: '
|
||||||
'The parameters of parameter group should be '
|
'The parameters of parameter group should be '
|
||||||
'a list.'), six.text_type(exc))
|
'a list.'), str(exc))
|
||||||
|
|
||||||
def test_validate_allowed_values_integer(self):
|
def test_validate_allowed_values_integer(self):
|
||||||
t = template_format.parse(test_template_allowed_integers)
|
t = template_format.parse(test_template_allowed_integers)
|
||||||
@ -1750,7 +1749,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
err = self.assertRaises(exception.StackValidationFailed,
|
err = self.assertRaises(exception.StackValidationFailed,
|
||||||
stack.validate)
|
stack.validate)
|
||||||
self.assertIn('"3" is not an allowed value [1, 4, 8]',
|
self.assertIn('"3" is not an allowed value [1, 4, 8]',
|
||||||
six.text_type(err))
|
str(err))
|
||||||
|
|
||||||
# test with size parameter provided as number
|
# test with size parameter provided as number
|
||||||
template.env = environment.Environment({'size': 3})
|
template.env = environment.Environment({'size': 3})
|
||||||
@ -1758,7 +1757,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
err = self.assertRaises(exception.StackValidationFailed,
|
err = self.assertRaises(exception.StackValidationFailed,
|
||||||
stack.validate)
|
stack.validate)
|
||||||
self.assertIn('3 is not an allowed value [1, 4, 8]',
|
self.assertIn('3 is not an allowed value [1, 4, 8]',
|
||||||
six.text_type(err))
|
str(err))
|
||||||
|
|
||||||
def test_validate_not_allowed_values_integer_str(self):
|
def test_validate_not_allowed_values_integer_str(self):
|
||||||
t = template_format.parse(test_template_allowed_integers_str)
|
t = template_format.parse(test_template_allowed_integers_str)
|
||||||
@ -1770,7 +1769,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
err = self.assertRaises(exception.StackValidationFailed,
|
err = self.assertRaises(exception.StackValidationFailed,
|
||||||
stack.validate)
|
stack.validate)
|
||||||
self.assertIn('"3" is not an allowed value ["1", "4", "8"]',
|
self.assertIn('"3" is not an allowed value ["1", "4", "8"]',
|
||||||
six.text_type(err))
|
str(err))
|
||||||
|
|
||||||
# test with size parameter provided as number
|
# test with size parameter provided as number
|
||||||
template.env = environment.Environment({'size': 3})
|
template.env = environment.Environment({'size': 3})
|
||||||
@ -1778,7 +1777,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
err = self.assertRaises(exception.StackValidationFailed,
|
err = self.assertRaises(exception.StackValidationFailed,
|
||||||
stack.validate)
|
stack.validate)
|
||||||
self.assertIn('3 is not an allowed value ["1", "4", "8"]',
|
self.assertIn('3 is not an allowed value ["1", "4", "8"]',
|
||||||
six.text_type(err))
|
str(err))
|
||||||
|
|
||||||
def test_validate_invalid_outputs(self):
|
def test_validate_invalid_outputs(self):
|
||||||
t = template_format.parse(test_template_invalid_outputs)
|
t = template_format.parse(test_template_invalid_outputs)
|
||||||
@ -1789,7 +1788,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
error_message = ('outputs.string.value.get_attr: Arguments to '
|
error_message = ('outputs.string.value.get_attr: Arguments to '
|
||||||
'"get_attr" must be of the form '
|
'"get_attr" must be of the form '
|
||||||
'[resource_name, attribute, (path), ...]')
|
'[resource_name, attribute, (path), ...]')
|
||||||
self.assertEqual(error_message, six.text_type(err))
|
self.assertEqual(error_message, str(err))
|
||||||
|
|
||||||
def test_validate_resource_attr_invalid_type(self):
|
def test_validate_resource_attr_invalid_type(self):
|
||||||
t = template_format.parse("""
|
t = template_format.parse("""
|
||||||
@ -1802,7 +1801,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
stack = parser.Stack(self.ctx, 'test_stack', template)
|
stack = parser.Stack(self.ctx, 'test_stack', template)
|
||||||
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
||||||
self.assertEqual('Resource resource type type must be string',
|
self.assertEqual('Resource resource type type must be string',
|
||||||
six.text_type(ex))
|
str(ex))
|
||||||
|
|
||||||
def test_validate_resource_attr_invalid_type_cfn(self):
|
def test_validate_resource_attr_invalid_type_cfn(self):
|
||||||
t = template_format.parse("""
|
t = template_format.parse("""
|
||||||
@ -1814,7 +1813,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
stack = parser.Stack(self.ctx, 'test_stack', tmpl.Template(t))
|
stack = parser.Stack(self.ctx, 'test_stack', tmpl.Template(t))
|
||||||
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
||||||
self.assertEqual('Resource Resource Type type must be string',
|
self.assertEqual('Resource Resource Type type must be string',
|
||||||
six.text_type(ex))
|
str(ex))
|
||||||
|
|
||||||
def test_validate_resource_invalid_key(self):
|
def test_validate_resource_invalid_key(self):
|
||||||
t = template_format.parse("""
|
t = template_format.parse("""
|
||||||
@ -1827,7 +1826,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
template = tmpl.Template(t)
|
template = tmpl.Template(t)
|
||||||
stack = parser.Stack(self.ctx, 'test_stack', template)
|
stack = parser.Stack(self.ctx, 'test_stack', template)
|
||||||
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
||||||
self.assertIn('wibble', six.text_type(ex))
|
self.assertIn('wibble', str(ex))
|
||||||
|
|
||||||
def test_validate_resource_invalid_cfn_key_in_hot(self):
|
def test_validate_resource_invalid_cfn_key_in_hot(self):
|
||||||
t = template_format.parse("""
|
t = template_format.parse("""
|
||||||
@ -1840,7 +1839,7 @@ class ValidateTest(common.HeatTestCase):
|
|||||||
template = tmpl.Template(t)
|
template = tmpl.Template(t)
|
||||||
stack = parser.Stack(self.ctx, 'test_stack', template)
|
stack = parser.Stack(self.ctx, 'test_stack', template)
|
||||||
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
ex = self.assertRaises(exception.StackValidationFailed, stack.validate)
|
||||||
self.assertIn('Properties', six.text_type(ex))
|
self.assertIn('Properties', str(ex))
|
||||||
|
|
||||||
def test_validate_resource_invalid_key_cfn(self):
|
def test_validate_resource_invalid_key_cfn(self):
|
||||||
t = template_format.parse("""
|
t = template_format.parse("""
|
||||||
|
@ -15,14 +15,13 @@ import random
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
|
import urllib
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from heatclient import exc as heat_exceptions
|
from heatclient import exc as heat_exceptions
|
||||||
from keystoneauth1 import exceptions as kc_exceptions
|
from keystoneauth1 import exceptions as kc_exceptions
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
import six
|
|
||||||
from six.moves import urllib
|
|
||||||
from tempest import config
|
from tempest import config
|
||||||
import testscenarios
|
import testscenarios
|
||||||
import testtools
|
import testtools
|
||||||
@ -59,7 +58,7 @@ def call_until_true(duration, sleep_for, func, *args, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
def rand_name(name=''):
|
def rand_name(name=''):
|
||||||
randbits = six.text_type(random.randint(1, 0x7fffffff))
|
randbits = str(random.randint(1, 0x7fffffff))
|
||||||
if name:
|
if name:
|
||||||
return name + '-' + randbits
|
return name + '-' + randbits
|
||||||
else:
|
else:
|
||||||
|
@ -15,7 +15,6 @@ import json
|
|||||||
|
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import six
|
|
||||||
from testtools import matchers
|
from testtools import matchers
|
||||||
|
|
||||||
from heat_integrationtests.common import test
|
from heat_integrationtests.common import test
|
||||||
@ -736,7 +735,7 @@ outputs:
|
|||||||
stack_identifier, 'ScaleUpPolicy')
|
stack_identifier, 'ScaleUpPolicy')
|
||||||
|
|
||||||
error_msg = 'Signal resource during SUSPEND is not supported'
|
error_msg = 'Signal resource during SUSPEND is not supported'
|
||||||
self.assertIn(error_msg, six.text_type(ex))
|
self.assertIn(error_msg, str(ex))
|
||||||
ev = self.wait_for_event_with_reason(
|
ev = self.wait_for_event_with_reason(
|
||||||
stack_identifier,
|
stack_identifier,
|
||||||
reason='Cannot signal resource during SUSPEND',
|
reason='Cannot signal resource during SUSPEND',
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
|
from urllib import parse
|
||||||
|
|
||||||
from six.moves.urllib import parse
|
|
||||||
from swiftclient import utils as swiftclient_utils
|
from swiftclient import utils as swiftclient_utils
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ import copy
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from heatclient import exc
|
from heatclient import exc
|
||||||
import six
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from heat_integrationtests.functional import functional_base
|
from heat_integrationtests.functional import functional_base
|
||||||
@ -88,12 +87,12 @@ resources:
|
|||||||
ex = self.assertRaises(exc.HTTPBadRequest, self.update_stack,
|
ex = self.assertRaises(exc.HTTPBadRequest, self.update_stack,
|
||||||
stack_identifier, template_two_nested,
|
stack_identifier, template_two_nested,
|
||||||
environment=env, files=files)
|
environment=env, files=files)
|
||||||
self.assertIn(expected_err, six.text_type(ex))
|
self.assertIn(expected_err, str(ex))
|
||||||
|
|
||||||
ex = self.assertRaises(exc.HTTPBadRequest, self.stack_create,
|
ex = self.assertRaises(exc.HTTPBadRequest, self.stack_create,
|
||||||
template=template_two_nested,
|
template=template_two_nested,
|
||||||
environment=env, files=files)
|
environment=env, files=files)
|
||||||
self.assertIn(expected_err, six.text_type(ex))
|
self.assertIn(expected_err, str(ex))
|
||||||
|
|
||||||
def _validate_resources(self, stack_identifier, expected_count):
|
def _validate_resources(self, stack_identifier, expected_count):
|
||||||
resources = self.list_group_resources(stack_identifier,
|
resources = self.list_group_resources(stack_identifier,
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
from heatclient import exc as heat_exceptions
|
from heatclient import exc as heat_exceptions
|
||||||
import six
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from heat_integrationtests.common import test
|
from heat_integrationtests.common import test
|
||||||
@ -804,7 +803,7 @@ outputs:
|
|||||||
except heat_exceptions.HTTPBadRequest as exc:
|
except heat_exceptions.HTTPBadRequest as exc:
|
||||||
exp = ('ERROR: Required property two for facade '
|
exp = ('ERROR: Required property two for facade '
|
||||||
'OS::Thingy missing in provider')
|
'OS::Thingy missing in provider')
|
||||||
self.assertEqual(exp, six.text_type(exc))
|
self.assertEqual(exp, str(exc))
|
||||||
|
|
||||||
def test_missing_output(self):
|
def test_missing_output(self):
|
||||||
templ_missing_output = '''
|
templ_missing_output = '''
|
||||||
@ -828,7 +827,7 @@ resources:
|
|||||||
except heat_exceptions.HTTPBadRequest as exc:
|
except heat_exceptions.HTTPBadRequest as exc:
|
||||||
exp = ('ERROR: Attribute here-it-is for facade '
|
exp = ('ERROR: Attribute here-it-is for facade '
|
||||||
'OS::Thingy missing in provider')
|
'OS::Thingy missing in provider')
|
||||||
self.assertEqual(exp, six.text_type(exc))
|
self.assertEqual(exp, str(exc))
|
||||||
|
|
||||||
|
|
||||||
class TemplateResourceNewParamTest(functional_base.FunctionalTestsBase):
|
class TemplateResourceNewParamTest(functional_base.FunctionalTestsBase):
|
||||||
|
@ -59,7 +59,6 @@ PyYAML>=3.12 # MIT
|
|||||||
requests>=2.14.2 # Apache-2.0
|
requests>=2.14.2 # Apache-2.0
|
||||||
tenacity>=4.4.0 # Apache-2.0
|
tenacity>=4.4.0 # Apache-2.0
|
||||||
Routes>=2.3.1 # MIT
|
Routes>=2.3.1 # MIT
|
||||||
six>=1.10.0 # MIT
|
|
||||||
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
SQLAlchemy!=1.1.5,!=1.1.6,!=1.1.7,!=1.1.8,>=1.0.10 # MIT
|
||||||
sqlalchemy-migrate>=0.11.0 # Apache-2.0
|
sqlalchemy-migrate>=0.11.0 # Apache-2.0
|
||||||
stevedore>=1.20.0 # Apache-2.0
|
stevedore>=1.20.0 # Apache-2.0
|
||||||
|
@ -16,7 +16,6 @@ import re
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
import six
|
|
||||||
|
|
||||||
from heat.common.i18n import _
|
from heat.common.i18n import _
|
||||||
from heat.engine import constraints
|
from heat.engine import constraints
|
||||||
@ -101,7 +100,7 @@ class HeatCustomGuidelines(object):
|
|||||||
|
|
||||||
def _check_resource_schemas(self, resource, schema, schema_name,
|
def _check_resource_schemas(self, resource, schema, schema_name,
|
||||||
error_path=None):
|
error_path=None):
|
||||||
for key, value in six.iteritems(schema):
|
for key, value in schema.items():
|
||||||
if error_path is None:
|
if error_path is None:
|
||||||
error_path = [resource.__name__, key]
|
error_path = [resource.__name__, key]
|
||||||
else:
|
else:
|
||||||
@ -129,7 +128,7 @@ class HeatCustomGuidelines(object):
|
|||||||
error_path.pop()
|
error_path.pop()
|
||||||
|
|
||||||
def _check_resource_methods(self, resource):
|
def _check_resource_methods(self, resource):
|
||||||
for method in six.itervalues(resource.__dict__):
|
for method in resource.__dict__.values():
|
||||||
# need to skip non-functions attributes
|
# need to skip non-functions attributes
|
||||||
if not callable(method):
|
if not callable(method):
|
||||||
continue
|
continue
|
||||||
@ -159,7 +158,7 @@ class HeatCustomGuidelines(object):
|
|||||||
cls_file = open(cls.__module__.replace('.', '/') + '.py')
|
cls_file = open(cls.__module__.replace('.', '/') + '.py')
|
||||||
except IOError as ex:
|
except IOError as ex:
|
||||||
LOG.warning('Cannot perform trailing spaces check on '
|
LOG.warning('Cannot perform trailing spaces check on '
|
||||||
'resource module: %s', six.text_type(ex))
|
'resource module: %s', str(ex))
|
||||||
continue
|
continue
|
||||||
lines = [line.strip() for line in cls_file.readlines()]
|
lines = [line.strip() for line in cls_file.readlines()]
|
||||||
idx = 0
|
idx = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user