Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(gce): fix how gce checks for an operation done (#440)
Previous implementation relied on the __repr__ or __str__ representation of an internal google sdk enum, which, under some versions of the sdk is `Status.DONE` and under others is an integer. Running cloud-init integration tests with Python 3.12.3 raises: E pycloudlib.errors.PycloudlibError: Expected DONE state, but found 2104194 after waiting 300 seconds. Check GCE console for more details. Use the enum variant DONE for proper comparison. Both, ZoneOperationsClient[0] and GlobalOperationsClient[1]'s get method return an instance of Operation[2] which has an instance of Status[3] as status property. Refs: [0] https://cloud.google.com/python/docs/reference/compute/1.11.0/google.cloud.compute_v1.services.zone_operations.ZoneOperationsClient#google_cloud_compute_v1_services_zone_operations_ZoneOperationsClient_get [1] https://cloud.google.com/python/docs/reference/compute/1.11.0/google.cloud.compute_v1.services.global_operations.GlobalOperationsClient#google_cloud_compute_v1_services_global_operations_GlobalOperationsClient_get [2] https://cloud.google.com/python/docs/reference/compute/1.11.0/google.cloud.compute_v1.types.operation [3] https://cloud.google.com/python/docs/reference/compute/1.11.0/google.cloud.compute_v1.types.Operation.Status
- Loading branch information