예제 #1
0
    def remove_parameters_by_namespace(self, namespace):
        """Removes all parameters in the given namespace.

        :type namespace: str
        """
        self._parameters = [
            p for p in self.parameters
            if not ns_utils.matches_template_namespace(namespace, p.name)]
예제 #2
0
파일: heat.py 프로젝트: erictchiu/tuskar
    def remove_parameters_by_namespace(self, namespace):
        """Removes all parameters in the given namespace.

        :type namespace: str
        """
        self._parameters = [
            p for p in self.parameters
            if not ns_utils.matches_template_namespace(namespace, p.name)]
예제 #3
0
파일: heat.py 프로젝트: erictchiu/tuskar
    def remove_outputs_by_namespace(self, namespace):
        """Removes all outputs in the given namespace from the template.

        :type namespace: str
        """
        self._outputs = [
            o for o in self.outputs
            if not ns_utils.matches_template_namespace(namespace, o.name)]
예제 #4
0
    def remove_outputs_by_namespace(self, namespace):
        """Removes all outputs in the given namespace from the template.

        :type namespace: str
        """
        self._outputs = [
            o for o in self.outputs
            if not ns_utils.matches_template_namespace(namespace, o.name)]
예제 #5
0
파일: heat.py 프로젝트: erictchiu/tuskar
    def has_parameter_in_namespace(self, namespace):
        """Returns true if the environment has at least one parameter
        in given namespace, false otherwise.

        :type namespace: str
        """
        for p in self._parameters:
            if ns_utils.matches_template_namespace(namespace, p.name):
                return True
        return False
예제 #6
0
파일: heat.py 프로젝트: erictchiu/tuskar
    def has_parameter_in_namespace(self, namespace):
        """Returns true if the environment has at least one parameter
        in given namespace, false otherwise.

        :type namespace: str
        """
        for p in self._parameters:
            if ns_utils.matches_template_namespace(namespace, p.name):
                return True
        return False
예제 #7
0
 def test_matches_template_namespace(self):
     value = 'test-ns::test-name'
     self.assertTrue(namespace.matches_template_namespace('test-ns', value))
     self.assertFalse(namespace.matches_template_namespace('fake', value))
예제 #8
0
 def test_apply_template_namespace(self):
     namespaced = namespace.apply_template_namespace('test-ns', 'test-name')
     self.assertEqual(namespaced, 'test-ns::test-name')
     self.assertTrue(
         namespace.matches_template_namespace('test-ns', namespaced))
예제 #9
0
 def test_matches_template_namespace(self):
     value = 'test-ns::test-name'
     self.assertTrue(namespace.matches_template_namespace('test-ns', value))
     self.assertFalse(namespace.matches_template_namespace('fake', value))
예제 #10
0
 def test_apply_template_namespace(self):
     namespaced = namespace.apply_template_namespace('test-ns', 'test-name')
     self.assertEqual(namespaced, 'test-ns::test-name')
     self.assertTrue(namespace.matches_template_namespace('test-ns',
                                                          namespaced))