summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 766db70..b59f0f0 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -1320,8 +1320,14 @@ def action_image_update():
form.ip.data = ' '.join(ips)
server = get_server_from_clients(ips)
- r = server.get('/images')
- for image in r.json()['images']:
+ r = server.get('/client/info', payload={'client': list(ips)})
+ repo_id = r.json()['repo_id']
+ images = get_images_grouped_by_repos_from_server(server)
+ if repo_id not in images:
+ flash(_('Computer is assigned to a repo with no images'),
+ category='error')
+ return redirect(url_for('commands'))
+ for image in images[repo_id]:
form.image.choices.append((image['id'], image['name']))
r = server.get('/client/setup', payload={'client': list(ips)})