diff --git a/heat/engine/resources/openstack/sahara/cluster.py b/heat/engine/resources/openstack/sahara/cluster.py index c051c57e4b..2a71909bed 100644 --- a/heat/engine/resources/openstack/sahara/cluster.py +++ b/heat/engine/resources/openstack/sahara/cluster.py @@ -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] diff --git a/heat/tests/openstack/sahara/test_cluster.py b/heat/tests/openstack/sahara/test_cluster.py index dd4e58c5a6..a09971254c 100644 --- a/heat/tests/openstack/sahara/test_cluster.py +++ b/heat/tests/openstack/sahara/test_cluster.py @@ -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 = '''