terraform-enterprise-api-python-client icon indicating copy to clipboard operation
terraform-enterprise-api-python-client copied to clipboard

workspace update doesn't work

Open Neodbaryd opened this issue 2 years ago • 0 comments

Hi, trying to update multiple workspaces by updating working directories to normalized.

        workspace.update(
            working_directory=normalized,
        )

Error:

TypeError: Object of type object_helper is not JSON serializable

After debugging, the payload send:

{
    "data": {
        "attributes": {
            "name": "xxx",
            "terraform_version": "1.1-latest",
            "working-directory": "xxx",
            "auto-apply": false,
            "queue-all-runs": false,
            "trigger-prefixes": [],
            "vcs-repo": <pyterprise._api_response_object.object_helper object at 0x10bdedf00>
        },
        "type": "workspaces"
    }
}

solving my issue with

        workspace.update(
            working_directory=normalized,
            vcs_repo=workspace.vcs_repo.d,
        )

Neodbaryd avatar Apr 13 '23 16:04 Neodbaryd