summaryrefslogtreecommitdiffstats
path: root/cli/objects
diff options
context:
space:
mode:
Diffstat (limited to 'cli/objects')
-rw-r--r--cli/objects/images.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/cli/objects/images.py b/cli/objects/images.py
index 78c6135..a094469 100644
--- a/cli/objects/images.py
+++ b/cli/objects/images.py
@@ -118,11 +118,6 @@ class OgImage():
nargs='?',
required=True,
help='Image description')
- parser.add_argument('--repo-id',
- nargs='?',
- default=1,
- type=int,
- help='Images repository id (Default: 1)')
group = parser.add_argument_group('clients', 'Client selection args')
group.add_argument('--client-ip',
action='append',
@@ -133,6 +128,7 @@ class OgImage():
r = rest.get('/client/info', payload={'client': parsed_args.client_ip})
center_id = r.json()['center']
+ repo_id = r.json()['repo_id']
r = rest.get('/client/setup',
payload={'client': parsed_args.client_ip})
@@ -147,10 +143,9 @@ class OgImage():
payload = {'clients': parsed_args.client_ip, 'disk': parsed_args.disk, 'center_id': center_id,
'partition': parsed_args.part, 'code': str(fs_code), 'name': parsed_args.name,
- 'id': '0'}
+ 'id': '0', 'repository_id': repo_id}
if parsed_args.desc:
payload['description'] = parsed_args.desc
- payload['repository_id'] = parsed_args.repo_id
rest.post('/image/create', payload=payload)
@@ -174,11 +169,6 @@ class OgImage():
required=False,
default=False,
help='Create a backup before updating the image (No backup is created by default)')
- parser.add_argument('--repo-id',
- nargs='?',
- default=1,
- type=int,
- help='Images repository id (Default: 1)')
group = parser.add_argument_group('clients', 'Client selection args')
group.add_argument('--client-ip',
action='append',
@@ -189,6 +179,7 @@ class OgImage():
r = rest.get('/client/info', payload={'client': parsed_args.client_ip})
center_id = r.json()['center']
+ repo_id = int(r.json()['repo_id'])
r = rest.get('/client/setup',
payload={'client': parsed_args.client_ip})
@@ -215,7 +206,7 @@ class OgImage():
else:
print(f'Updating {image_name} image')
- payload = {'repository_id': parsed_args.repo_id,
+ payload = {'repository_id': repo_id,
'clients': parsed_args.client_ip,
'partition': parsed_args.part,
'backup': parsed_args.backup,