From 493452fdbf0e4659e1867993710d071a05fa031e Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Mon, 22 Nov 2021 16:27:28 -0600 Subject: [PATCH] Re-add 'owner' tag on phpIPAM reservation note inside 'try' block to work around bug in vRA 8.6 --- src/main/python/allocate_ip/source.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/python/allocate_ip/source.py b/src/main/python/allocate_ip/source.py index 8321297..b414628 100644 --- a/src/main/python/allocate_ip/source.py +++ b/src/main/python/allocate_ip/source.py @@ -145,9 +145,14 @@ def allocate_in_range(range_id, resource, allocation, context, endpoint, bundle) uri = bundle['uri'] token = bundle['token'] cert = bundle['cert'] + # Attempt to grab 'owner' to work around bug in vRA 8.6 (fixed in 8.6.1) + try: + owner_string = f" for {resource['owner']} " + except: + owner_string = " " payload = { 'hostname': vmName, - 'description': f'Reserved by vRA at {datetime.now()}' + 'description': f'Reserved by vRA{owner_string}at {datetime.now()}' } allocate_uri = f'{uri}/addresses/first_free/{str(range_id)}/' allocate_req = requests.post(allocate_uri, data=payload, headers=token, verify=cert)