Merge "Don't ignore 'capabilities' flavor extra_spec"
This commit is contained in:
		@@ -37,9 +37,10 @@ class ComputeCapabilitiesFilter(filters.BaseHostFilter):
 | 
			
		||||
        for key, req in instance_type['extra_specs'].iteritems():
 | 
			
		||||
            # Either not scope format, or in capabilities scope
 | 
			
		||||
            scope = key.split(':')
 | 
			
		||||
            if len(scope) > 1 and scope[0] != "capabilities":
 | 
			
		||||
            if len(scope) > 1:
 | 
			
		||||
                if scope[0] != "capabilities":
 | 
			
		||||
                    continue
 | 
			
		||||
            elif scope[0] == "capabilities":
 | 
			
		||||
                else:
 | 
			
		||||
                    del scope[0]
 | 
			
		||||
            cap = capabilities
 | 
			
		||||
            for index in range(0, len(scope)):
 | 
			
		||||
 
 | 
			
		||||
@@ -795,6 +795,13 @@ class HostFiltersTestCase(test.NoDBTestCase):
 | 
			
		||||
                    'trust:trusted_host': 'true'},
 | 
			
		||||
            passes=True)
 | 
			
		||||
 | 
			
		||||
    def test_compute_filter_pass_extra_specs_same_as_scope(self):
 | 
			
		||||
        # Make sure this still works even if the key is the same as the scope
 | 
			
		||||
        self._do_test_compute_filter_extra_specs(
 | 
			
		||||
            ecaps={'capabilities': 1},
 | 
			
		||||
            especs={'capabilities': '1'},
 | 
			
		||||
            passes=True)
 | 
			
		||||
 | 
			
		||||
    def test_compute_filter_extra_specs_simple_with_wrong_scope(self):
 | 
			
		||||
        self._do_test_compute_filter_extra_specs(
 | 
			
		||||
            ecaps={'opt1': 1, 'opt2': 2},
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user