Merge "Fix 'unable to exclude instance'"
This commit is contained in:
commit
a94e35b60e
|
@ -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)
|
||||
|
|
|
@ -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'}]},
|
||||
]}]
|
||||
}
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue