remove reference to resourceInfo['owner'] to work around problem with vRA 8.6

This commit is contained in:
John Bowdre 2021-10-19 16:02:53 -05:00
parent 3797a59310
commit 21ed9d7c66
2 changed files with 2 additions and 3 deletions

View file

@ -23,7 +23,7 @@ conditions of the subcomponent's license, as noted in the LICENSE file.
<properties>
<provider.name>phpIPAM</provider.name>
<provider.description>phpIPAM integration for vRA</provider.description>
<provider.version>1.0.3</provider.version>
<provider.version>1.0.4</provider.version>
<provider.supportsAddressSpaces>false</provider.supportsAddressSpaces>
<provider.supportsUpdateRecord>true</provider.supportsUpdateRecord>

View file

@ -142,13 +142,12 @@ def allocate(resource, allocation, context, endpoint, bundle):
def allocate_in_range(range_id, resource, allocation, context, endpoint, bundle):
if int(allocation['size']) ==1:
vmName = resource['name']
owner = resource['owner']
uri = bundle['uri']
token = bundle['token']
cert = bundle['cert']
payload = {
'hostname': vmName,
'description': f'Reserved by vRA for {owner} at {datetime.now()}'
'description': f'Reserved by vRA 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)