Merge "Do not validate property network of sahara cluster"

This commit is contained in:
Zuul 2017-10-24 04:39:26 +00:00 committed by Gerrit Code Review
commit 1f73478e32
2 changed files with 4 additions and 10 deletions

View File

@ -126,6 +126,7 @@ class SaharaCluster(resource.Resource):
MANAGEMENT_NETWORK: properties.Schema(
properties.Schema.STRING,
_('Name or UUID of network.'),
required=True,
constraints=[
constraints.CustomConstraint('neutron.network')
],
@ -282,13 +283,6 @@ class SaharaCluster(resource.Resource):
if res:
return res
# check if running on neutron and MANAGEMENT_NETWORK missing
if (self.is_using_neutron() and
not self.properties[self.MANAGEMENT_NETWORK]):
msg = _("%s must be provided"
) % self.MANAGEMENT_NETWORK
raise exception.StackValidationFailed(message=msg)
self.client_plugin().validate_hadoop_version(
self.properties[self.PLUGIN_NAME],
self.properties[self.HADOOP_VERSION]

View File

@ -176,11 +176,11 @@ class SaharaClusterTest(common.HeatTestCase):
self.t['resources']['super-cluster']['properties'].pop(
'neutron_management_network')
cluster = self._init_cluster(self.t)
self.patchobject(cluster, 'is_using_neutron', return_value=True)
ex = self.assertRaises(exception.StackValidationFailed,
cluster.validate)
self.assertEqual("neutron_management_network must be provided",
six.text_type(ex))
error_msg = ('Property error: resources.super-cluster.properties: '
'Property neutron_management_network not assigned')
self.assertEqual(error_msg, six.text_type(ex))
def test_deprecated_properties_correctly_translates(self):
tmpl = '''