Compare commits
2 Commits
client-spe
...
8283f972e4
| Author | SHA1 | Date | |
|---|---|---|---|
| 8283f972e4 | |||
|
|
0d97ba1f93 |
@@ -22,7 +22,8 @@ sed -i "s,version = \"${current_version}\",version = \"${new_version}\"," node-d
|
||||
sed -i "s,version = \"${current_version}\",version = \"${new_version}\"," health-daemon/pvchealthd/Daemon.py
|
||||
sed -i "s,version = \"${current_version}\",version = \"${new_version}\"," worker-daemon/pvcworkerd/Daemon.py
|
||||
sed -i "s,version = \"${current_version}\",version = \"${new_version}\"," api-daemon/pvcapid/Daemon.py
|
||||
sed -i "s,version=\"${current_version}\",version=\"${new_version}\"," client-cli/setup.py
|
||||
sed -i "s,version = \"${current_version}\",version = \"${new_version}\"," client-cli/pyproject.toml
|
||||
sed -i "s,VERSION = \"${current_version}\",VERSION = \"${new_version}\"," client-cli/pvc/cli/cli.py
|
||||
echo ${new_version} > .version
|
||||
|
||||
changelog_tmpdir=$( mktemp -d )
|
||||
|
||||
@@ -51,6 +51,8 @@ import click
|
||||
###############################################################################
|
||||
|
||||
|
||||
VERSION = "0.9.107"
|
||||
|
||||
CONTEXT_SETTINGS = dict(
|
||||
help_option_names=["-h", "--help"], max_content_width=MAX_CONTENT_WIDTH
|
||||
)
|
||||
@@ -97,10 +99,7 @@ def version(ctx, param, value):
|
||||
if not value or ctx.resilient_parsing:
|
||||
return
|
||||
|
||||
from pkg_resources import get_distribution
|
||||
|
||||
version = get_distribution("pvc").version
|
||||
echo(CLI_CONFIG, f"Parallel Virtual Cluster CLI client version {version}")
|
||||
echo(CLI_CONFIG, f"Parallel Virtual Cluster CLI client version {VERSION}")
|
||||
ctx.exit()
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ from requests import get, post, put, patch, delete, Response
|
||||
from requests.exceptions import ConnectionError
|
||||
from time import time
|
||||
from urllib3 import disable_warnings
|
||||
from pvc.cli.cli import VERSION
|
||||
|
||||
|
||||
def format_bytes(size_bytes):
|
||||
@@ -166,6 +167,9 @@ def call_api(
|
||||
config["api_scheme"], config["api_host"], config["api_prefix"], request_uri
|
||||
)
|
||||
|
||||
# Add custom User-Agent header
|
||||
headers["User-Agent"] = f"pvc-client-cli/{VERSION}"
|
||||
|
||||
# Craft the authentication header if required
|
||||
if config["api_key"]:
|
||||
headers["X-Api-Key"] = config["api_key"]
|
||||
|
||||
@@ -605,12 +605,14 @@ def rename_vm(zkhandler, domain, new_domain):
|
||||
rbd_list.append(disk["name"].split("/")[1])
|
||||
|
||||
# Rename each volume in turn
|
||||
rbd_list_new = []
|
||||
for idx, rbd in enumerate(rbd_list):
|
||||
rbd_new = re.sub(r"{}".format(domain), new_domain, rbd)
|
||||
# Skip renaming if nothing changed
|
||||
if rbd_new == rbd:
|
||||
continue
|
||||
ceph.rename_volume(zkhandler, pool_list[idx], rbd, rbd_new)
|
||||
rbd_list_new.append(f"{pool_list[idx]}/{rbd_new}")
|
||||
|
||||
# Replace the name in the config
|
||||
vm_config_new = (
|
||||
@@ -627,6 +629,7 @@ def rename_vm(zkhandler, domain, new_domain):
|
||||
[
|
||||
(("domain", dom_uuid), new_domain),
|
||||
(("domain.xml", dom_uuid), vm_config_new),
|
||||
(("domain.rbdlist", dom_uuid), ",".join(rbd_list_new)),
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user