From 844c2e8187257404264cbb47401f4ab2e481bf23 Mon Sep 17 00:00:00 2001 From: Roland Sommer Date: Thu, 21 Dec 2023 13:36:27 +0100 Subject: [PATCH] Fix argument handling The `key` part of the argument handling has to be right after `args`, otherwise you'd get an `AttributeError` when trying to call `encode` on the `args` object. Signed-off-by: Roland Sommer --- .../vcenter/certificatemanagement/replace_tls_certificate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/vsphere/vcenter/certificatemanagement/replace_tls_certificate.py b/samples/vsphere/vcenter/certificatemanagement/replace_tls_certificate.py index 881f4bd2..70a4ee08 100644 --- a/samples/vsphere/vcenter/certificatemanagement/replace_tls_certificate.py +++ b/samples/vsphere/vcenter/certificatemanagement/replace_tls_certificate.py @@ -60,7 +60,7 @@ vsphere_client = create_vsphere_client(server=args.server, cert = args.cert.encode(encoding='utf-8').decode('unicode_escape') if args.key is not None: - key = args.encode(encoding='utf-8').key.decode('unicode_escape') + key = args.key.encode(encoding='utf-8').decode('unicode_escape') else: key = args.key