File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,27 @@ def get_regions(
5656 return Region (client , region_override )
5757
5858 regions = client .regions ()
59+ ALL_ACCOUNT_AVAILABILITIES = {
60+ "Linodes" ,
61+ "NodeBalancers" ,
62+ "Block Storage" ,
63+ "Kubernetes" ,
64+ }
65+ account_availabilities = client .account .availabilities ()
66+ account_regional_availabilities = {
67+ a .region : a .available for a in account_availabilities
68+ }
69+
70+ print (account_regional_availabilities )
5971
6072 if capabilities is not None :
6173 regions = [
62- v for v in regions if set (capabilities ).issubset (v .capabilities )
74+ v
75+ for v in regions
76+ if set (capabilities ).issubset (v .capabilities )
77+ and set (capabilities )
78+ .intersection (ALL_ACCOUNT_AVAILABILITIES )
79+ .issubset (account_regional_availabilities .get (v .id , []))
6380 ]
6481
6582 if site_type is not None :
You can’t perform that action at this time.
0 commit comments