summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-05-16 15:07:37 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-05-16 15:18:02 +0200
commitd8efd3321c759440c1f9f66b55b6b2c8b1edb67a (patch)
tree4d8c846d9e0ef07c73d05293b2e254fdd94fbec6 /cli
parent828d6c0ce7d4a6b4bcd95e97155460fd59856bdd (diff)
create image: fix --repo default ip value
rest.URL is the ip and port of the ogServer like: 192.168.56.10:8888, specified in ogcli.json. As long as the host and port is specified in rest.URL, split by the ':' character and extract the ip. Fixes OpenGnsys clients failing to execute the command due to invalid repository IP being fed to the underlying bash scripts.
Diffstat (limited to 'cli')
-rw-r--r--cli/objects/images.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/objects/images.py b/cli/objects/images.py
index 270dfc3..c696d53 100644
--- a/cli/objects/images.py
+++ b/cli/objects/images.py
@@ -117,7 +117,7 @@ class OgImage():
help='Image description (for new images)')
parser.add_argument('--repo',
nargs='?',
- default=urlparse(rest.URL).netloc,
+ default=urlparse(rest.URL).netloc.split(':')[0],
help='Images repository ip')
group = parser.add_argument_group('clients', 'Client selection args')
group.add_argument('--client-ip',