Merge "Fix provider "flavors" check"
This commit is contained in:
14
tests/fixtures/layouts/nodepool-provider-flavors.yaml
vendored
Normal file
14
tests/fixtures/layouts/nodepool-provider-flavors.yaml
vendored
Normal 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
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user