Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Fix HTTP 400 for CustomizationScript in update_guest_customization_section #789

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kgawda
Copy link

@kgawda kgawda commented Jan 24, 2022

Fix use of Customization Script in update_guest_customization_section().

Problem:
When adding CustomizationScript tag to a VM's XML that did not include it previously, then the original code would place it as a last tag. As described in Issue #635, Cloud Director requires these tags to be ordered in a specific way. This is why the result is:

HTTP 400 Bad Request - cvc-complex-type.2.4.a: Invalid content was found starting with element 'CustomizationScript'. One of '{"http://www.vmware.com/vcloud/v1.5":Link, WC[##other:"http://www.vmware.com/vcloud/v1.5"]}' is expected.

This PR modifies location where the CustomizationScript is added to XML request, if it was not present before. It fixes some cases mentioned in Issue #635.

Fix use of Customization Script in update_guest_customization_section().
If CustomizationScript tag was not present in VM's XML before, then this change puts it into correct place. Otherwise it would result in HTTP 400 Bad Request.

Signed-off-by: Konrad Gawda <[email protected]>
@vmwclabot
Copy link

@kgawda, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

@vmwclabot
Copy link

@kgawda, VMware has approved your signed contributor license agreement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants