diff options
author | Javier Hernandez <jhernandez@soleta.eu> | 2023-12-21 13:40:38 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2023-12-21 16:58:50 +0100 |
commit | 717a1021d30069bb1fa35df56a0ba61062fea84f (patch) | |
tree | a8935ea5b24629c99705f679bd63c3d4ca3feb70 /cli/objects | |
parent | cf4af2a0574f8229bfde15c791557436e2269dab (diff) |
images: Remove option to specify repo
Remove option to specify a repository when creating an image.
Remove option to specify a repository when updating an image.
These features is are not yet supported in ogserver.
With this commit, the image that is created/updated is assigned to the
same repo the client is assigned
Diffstat (limited to 'cli/objects')
-rw-r--r-- | cli/objects/images.py | 17 |
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, |