File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
tests/unit/api/controllers/v1 Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,12 @@ def enforce_cluster_master_size_supported():
9494 @decorator .decorator
9595 def wrapper (func , * args , ** kwargs ):
9696 cluster = args [1 ]
97- cluster_driver = driver .Driver .get_driver_for_cluster (
98- pecan .request .context , cluster )
97+ cluster_template = objects .ClusterTemplate .get (
98+ pecan .request .context , cluster .cluster_template_id )
99+ cluster_type = (cluster_template .server_type ,
100+ cluster_template .cluster_distro ,
101+ cluster_template .coe )
102+ cluster_driver = driver .Driver .get_driver (* cluster_type )
99103 # Call into the driver to validate initial master size
100104 cluster_driver .validate_master_size (cluster .master_count )
101105 return func (* args , ** kwargs )
Original file line number Diff line number Diff line change @@ -714,10 +714,10 @@ def test_create_cluster_with_non_existent_cluster_template_name(self):
714714 self .assertEqual (400 , response .status_int )
715715 self .assertTrue (response .json ['errors' ])
716716
717- def test_create_cluster_with_cluster_template_name (self ):
717+ def test_create_cluster_with_cluster_template_name_as_id (self ):
718718 modelname = self .cluster_template .name
719- bdict = apiutils .cluster_post_data (name = modelname )
720- response = self .post_json ('/clusters' , bdict , expect_errors = True )
719+ bdict = apiutils .cluster_post_data (cluster_template_id = modelname )
720+ response = self .post_json ('/clusters' , bdict )
721721 self .assertEqual ('application/json' , response .content_type )
722722 self .assertEqual (202 , response .status_int )
723723
You can’t perform that action at this time.
0 commit comments