Skip to content

Commit df08398

Browse files
author
Clark Perkins
committed
Fixed an issue with creating blueprints
1 parent 4a05e52 commit df08398

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

stackdio/client/blueprint.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ def create_blueprint(self, blueprint):
4343
break
4444

4545
for formula in used_formulas:
46-
components = self._get(
47-
'{0}?version={1}'.format(formula['components'], formula['version']),
48-
jsonify=True,
49-
)['results']
46+
components = self.list_components_for_version(formula['id'], formula['version'])
5047
for component in components:
5148
formula_map[component['sls_path']] = formula['uri']
5249

stackdio/client/formula.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ def get_formula(self, formula_id):
4646
"""Get a formula with matching id"""
4747
pass
4848

49+
@get('formulas/{formula_id}/components/?version={version}', paginate=True)
50+
def list_components_for_version(self, formula_id, version):
51+
pass
52+
4953
@get('formulas/', paginate=True)
5054
def search_formulas(self, **kwargs):
5155
"""Get a formula with matching id"""

stackdio/client/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def __call__(self, *args, **kwargs):
158158
if method == 'GET' and paginate and jsonify:
159159
res = response['results']
160160

161-
next_url = response['next']
161+
next_url = response.get('next')
162162

163163
while next_url:
164164
next_page = requests.request(method,
@@ -169,7 +169,7 @@ def __call__(self, *args, **kwargs):
169169
params=kwargs,
170170
verify=self.obj._http_options['verify']).json()
171171
res.extend(next_page['results'])
172-
next_url = next_page['next']
172+
next_url = next_page.get('next')
173173

174174
response = res
175175

0 commit comments

Comments
 (0)