ogcli/cli
Jose M. Guisado c417964179 Fix fallback --repo value in 'restore image'
'--repo' was an optional argument to specify the ip of the machine
holding the image to be restored. In case it was not specified it
defaults to the ip specified inside ogcli.json for the ogServer

(ie. As fallback, we assume the repo is in the same machine as the
ogServer)

We retrieve the ip using urlparse from urllib.parse module. The parse
result has a 'netloc' member which holds the ip, but also any specified
port.

This resulted in a payload like:

	> ogcli restore image --id 3 --disk 1 --part 1
	--type unicast-direct --client-ip 192.168.56.11

	{"disk": "1", "partition": "1", "id": "1", "name": "pc11bak",
	"profile": "3", "repository": "192.168.56.10:8888", "type":
	"UNICAST-DIRECT", "clients": ["192.168.56.11"]}

Split netloc to avoid copying the ogServer port.
2021-03-31 15:07:40 +02:00
..
objects Fix fallback --repo value in 'restore image' 2021-03-31 15:07:40 +02:00
__init__.py Rename files to remove 'og' prefix 2020-06-30 12:51:51 +02:00
cli.py Add 'restore image' command 2021-03-30 14:01:39 +02:00
utils.py Fix utils.py 2021-03-30 13:29:06 +02:00