Fix bug 2153 to hide WIM password properly in command wim-show
[osm/osmclient.git] / osmclient / scripts / osm.py
index 397d932..02870e4 100755 (executable)
@@ -1014,7 +1014,7 @@ def ns_op_list(ctx, name, long):
             action_name = op["operationParams"]["primitive"]
         detail = "-"
         if op["operationState"] == "PROCESSING":
-            if op["queuePosition"] is not None and op["queuePosition"] > 0:
+            if op.get("queuePosition") is not None and op.get("queuePosition") > 0:
                 detail = "In queue. Current position: {}".format(op["queuePosition"])
             elif op["lcmOperationType"] in ("instantiate", "terminate"):
                 if op["stage"]:
@@ -3614,7 +3614,7 @@ def wim_show(ctx, name):
     check_client_version(ctx.obj, ctx.command.name)
     resp = ctx.obj.wim.get(name)
     if "password" in resp:
-        resp["wim_password"] = "********"
+        resp["password"] = "********"
     # except ClientException as e:
     #     print(str(e))
     #     exit(1)