From fca68171b66db9b39d6b13aa55ec1525f04b0d45 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 10 May 2022 15:48:22 +0200 Subject: create image: make --desc option optional --desc option is used only when creating a new image. A new image is any image that is not defined in the OpenGnsys DB. See commit d2f20d0be06617f421eecca111449d94672695eb (#942 Create DB image when calling POST /image/create) --- cli/objects/images.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cli') diff --git a/cli/objects/images.py b/cli/objects/images.py index 4383d4c..cf42dd4 100644 --- a/cli/objects/images.py +++ b/cli/objects/images.py @@ -112,8 +112,8 @@ class OgImage(): help='Image name') parser.add_argument('--desc', nargs='?', - required=True, - help='Image description') + required=False, + help='Image description (for new images)') parser.add_argument('--repo', nargs='?', default=urlparse(rest.URL).netloc, @@ -141,5 +141,8 @@ 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', 'description': parsed_args.desc} + 'repository': parsed_args.repo, 'id': '0'} + if parsed_args.desc: + payload['description'] = parsed_args.desc + rest.post('/image/create', payload=payload) -- cgit v1.2.3-18-g5258