diff --git a/library/check_flavors.py b/library/check_flavors.py index ae5862099..a140f421f 100644 --- a/library/check_flavors.py +++ b/library/check_flavors.py @@ -139,14 +139,15 @@ def validate_roles_and_flavors(roles_info, flavors): if not custom_resource_class: errors.append(resource_class_missing.format( flavor_name)) - if not custom_resource_class_val: + if key not in ["DISK_GB", "MEMORY_MB", "VCPU"] and \ + not custom_resource_class_val: errors.append(resource_class_value_incorrect. format(flavor_name)) disk = resource_specs.get("DISK_GB", None) memory = resource_specs.get("MEMORY_MB", None) vcpu = resource_specs.get("VCPU", None) - if any(int(resource) != 0 for resource in [disk, memory, - vcpu]): + if any(int(resource) != 0 for resource in [disk, + memory, vcpu]): errors.append(disable_standard_scheduling. format(flavor_name)) diff --git a/library/verify_profiles.py b/library/verify_profiles.py index 58e81e6f3..1ff0bf8ba 100644 --- a/library/verify_profiles.py +++ b/library/verify_profiles.py @@ -109,7 +109,7 @@ def verify_profiles(nodes, flavors): assigned_nodes = [uu for uu, caps in free_node_caps.items() if caps.get('profile') == profile] - required_count = scale - len(assigned_nodes) + required_count = int(scale) - len(assigned_nodes) if required_count < 0: warnings.append('%d nodes with profile %s won\'t be used ' diff --git a/releasenotes/notes/consider_existing_resources-addc5b2527d9db1b.yaml b/releasenotes/notes/consider_existing_resources-addc5b2527d9db1b.yaml new file mode 100644 index 000000000..b710b9199 --- /dev/null +++ b/releasenotes/notes/consider_existing_resources-addc5b2527d9db1b.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Existing resources "DISK_GB", "MEMORY_MB", "VCPU" were not considered to + be available in case of custom_resource_class_val == False, also use correct + types for resource comparison and required_count calculation.