Fix bug 2176 to update properly VCA without modifying the name
[osm/osmclient.git] / osmclient / cli_commands / vca.py
index f60f98f..fc33962 100755 (executable)
@@ -133,6 +133,7 @@ def load_file(file_path: str) -> Dict:
 @click.option(
     "--endpoints", help="Comma-separated list of IP or hostnames of the Juju controller"
 )
+@click.option("--newname", help="New name for the VCA")
 @click.option("--user", help="Username with admin priviledges")
 @click.option("--secret", help="Password of the specified username")
 @click.option("--cacert", help="CA certificate")
@@ -161,6 +162,7 @@ def load_file(file_path: str) -> Dict:
 def vca_update(
     ctx,
     name,
+    newname,
     endpoints,
     user,
     secret,
@@ -179,7 +181,8 @@ def vca_update(
     logger.debug("")
     utils.check_client_version(ctx.obj, ctx.command.name)
     vca = {}
-    vca["name"] = name
+    if newname:
+        vca["name"] = newname
     if endpoints:
         vca["endpoints"] = endpoints.split(",")
     if user: