Merge "Fix 'unable to exclude instance'"

This commit is contained in:
Zuul 2017-12-14 05:38:34 +00:00 committed by Gerrit Code Review
commit a94e35b60e
2 changed files with 11 additions and 6 deletions

View File

@ -154,12 +154,16 @@ class ComputeScope(base.BaseScope):
nodes_to_remove = set()
instances_to_exclude = []
instance_metadata = []
compute_scope = []
model_hosts = list(cluster_model.get_all_compute_nodes().keys())
if not self.scope:
for scope in self.scope:
compute_scope = scope.get('compute')
if not compute_scope:
return cluster_model
for rule in self.scope:
for rule in compute_scope:
if 'host_aggregates' in rule:
self._collect_aggregates(rule['host_aggregates'],
allowed_nodes)

View File

@ -14,10 +14,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
fake_scope_1 = [{'availability_zones': [{'name': 'AZ1'}]},
{'exclude':
[{'instances':
[{'uuid': 'INSTANCE_6'}]}]
fake_scope_1 = [{'compute': [{'availability_zones': [{'name': 'AZ1'}]},
{'exclude': [
{'instances': [
{'uuid': 'INSTANCE_6'}]},
]}]
}
]