Fix provider "flavors" check

We intend to disallow setting "flavors" in a provider, but the
word "flavors" was misspelled.

Change-Id: I22e58ae9cd10020e8cff5f09cfd32965d584df79
This commit is contained in:
James E. Blair
2025-09-23 17:13:26 -07:00
parent 7885143646
commit fba435633e
3 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
- flavor:
name: large
- section:
name: aws-base
abstract: true
connection: aws
- provider:
name: aws-us-east-1-main
section: aws-us-east-1
flavors:
- name: large
instance-type: t3.large

View File

@@ -1628,3 +1628,11 @@ class TestNodepoolConfig(LauncherBaseTestCase):
self.waitUntilSettled()
tenant = self.scheds.first.sched.abide.tenants.get('tenant-one')
self.assertFalse('badprovider' in tenant.layout.providers)
@simple_layout('layouts/nodepool-provider-flavors.yaml',
enable_nodepool=True)
def test_nodepool_provider_flavors(self):
layout = self.scheds.first.sched.abide.tenants.get('tenant-one').layout
self.assertEquals(1, len(layout.loading_errors))
self.assertIn('Flavor configuration not permitted in',
layout.loading_errors[0].error)

View File

@@ -514,7 +514,7 @@ class ProviderParser(object):
def fromYaml(self, conf):
self.schema(conf)
if 'flavor' in conf:
if 'flavors' in conf:
raise Exception("Flavor configuration not permitted in Provider, "
"only Section")