From 0c1a747a31b32a068078c27fb81bc158b2ea8af5 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 28 Jun 2022 16:04:23 +0200 Subject: 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") --- cli/objects/images.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cli') 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) -- cgit v1.2.3-18-g5258