summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-06-28 16:04:23 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-06-28 17:08:15 +0200
commit0c1a747a31b32a068078c27fb81bc158b2ea8af5 (patch)
tree35646a2a1f403302a45e63a44c51737985e63be7
parent8932e4c07e0d3292fe44c19a3bdeefcce68e4bc1 (diff)
create image: add repository_id param for new images
Adds 'repository_id' parameter when creating a *new* image (ie: using --desc). Removes unused --repo parameter. See ogServer commit: 52a38d3e574fb25b47d230bc87754583eb17b4a6 ("Use the repository id on image creation")
-rw-r--r--cli/objects/images.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/cli/objects/images.py b/cli/objects/images.py
index 577b648..2f9f879 100644
--- a/cli/objects/images.py
+++ b/cli/objects/images.py
@@ -118,10 +118,10 @@ class OgImage():
nargs='?',
required=False,
help='Image description (for new images)')
- parser.add_argument('--repo',
+ parser.add_argument('--repo-id',
nargs='?',
- default=urlparse(rest.URL).netloc.split(':')[0],
- help='Images repository ip')
+ default=1,
+ help='Images repository id')
group = parser.add_argument_group('clients', 'Client selection args')
group.add_argument('--client-ip',
action='append',
@@ -146,8 +146,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,
- 'repository': parsed_args.repo, 'id': '0'}
+ 'id': '0'}
if parsed_args.desc:
payload['description'] = parsed_args.desc
+ payload['repository_id'] = parsed_args.repo_id
rest.post('/image/create', payload=payload)