File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,21 @@ def get_placement_request(flavor):
27
27
return resources , required_traits
28
28
29
29
30
- def get_candidates (conn , resources , traits , flavor_name ):
30
+ def get_candidates (conn , resources , required_traits , flavor_name ):
31
31
resource_str = "," .join (
32
32
[key + ":" + str (value ) for key , value in resources .items () if value ]
33
33
)
34
- print (resource_str )
34
+ required_str = "," .join (required_traits )
35
+ forbidden_str = "COMPUTE_STATUS_DISABLED"
36
+
37
+ response = conn .placement .get (
38
+ "/allocation_candidates" ,
39
+ params = {"resources" : resource_str , "required" : required_str },
40
+ headers = {"OpenStack-API-Version" : "placement 1.29" }
41
+ )
42
+ raw_data = response .json ()
43
+ print (raw_data )
44
+ raise Exception ("asdf" )
35
45
return [], 0
36
46
37
47
You can’t perform that action at this time.
0 commit comments