Skip to content

Commit 751fa2b

Browse files
author
Clark Perkins
committed
Merge branch 'feature/fixes-for-cli'
2 parents c789163 + 58c2701 commit 751fa2b

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

stackdio/client/blueprint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def create_blueprint(self, blueprint, provider="ec2"):
4040
host["cloud_profile"] = self.get_profile_id(host["cloud_profile"], title=True) # noqa
4141

4242
for component in host["formula_components"]:
43-
if isinstance(component["id"], (tuple, list)):
43+
if not component.get("sls_path") and isinstance(component["id"], (tuple, list)):
4444
formula_id = self.get_formula_id(component["id"][0])
4545

4646
component["id"] = self.get_component_id(

stackdio/client/profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@ def get_profile_id(self, slug, title=False):
7575
if profile.get("slug" if not title else "title") == slug:
7676
return profile.get("id")
7777

78-
return StackException("Profile %s not found" % slug)
78+
raise StackException("Profile %s not found" % slug)

stackdio/client/region.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ def get_zone_id(self, title, type_name="ec2"):
8484
type_id = self.get_provider_type_id(type_name)
8585
for zone in result['results']:
8686
if zone.get("title") == title:
87-
region = self._get(zone.get("region"), jsonify=True)
88-
if region.get("provider_type") == type_id:
89-
return zone.get("id")
87+
if 'region' in zone:
88+
# For version 0.6.1
89+
region = self._get(zone['region'], jsonify=True)
90+
if region.get("provider_type") == type_id:
91+
return zone.get("id")
92+
elif 'provider_type' in zone:
93+
# For versions 0.5.*
94+
if zone['provider_type'] == type_id:
95+
return zone.get("id")
9096

9197
raise StackException("Zone %s not found for %s" % (title, type_name))

0 commit comments

Comments
 (0)