Fixes for novav21.aggregate_present
- improper 'aggregate_set_metadata' function call fix
- improper logic for metadata change check fix
Prod-Related: PROD-35146
Change-Id: Ic6e9fa7c59a16cdf7df15a8592efc9bb3df60899
diff --git a/_states/novav21.py b/_states/novav21.py
index 91b5900..138d295 100644
--- a/_states/novav21.py
+++ b/_states/novav21.py
@@ -195,7 +195,7 @@
name, availability_zone_name, cloud_name=cloud_name)
if metadata:
_call_nova_salt_module('aggregate_set_metadata', name)(
- cloud_name=cloud_name, **metadata)
+ name, cloud_name=cloud_name, **metadata)
aggregate['metadata'] = metadata
for host in hosts or []:
_call_nova_salt_module('aggregate_add_host', name)(
@@ -207,7 +207,7 @@
changes = {}
existing_meta = set(aggregate['metadata'].items())
requested_meta = set(metadata.items())
- if hosts and (existing_meta - requested_meta or requested_meta - existing_meta):
+ if existing_meta - requested_meta or requested_meta - existing_meta:
_call_nova_salt_module('aggregate_set_metadata', name)(
name, cloud_name=cloud_name, **metadata)
changes['metadata'] = metadata