Open cu opened 2 years ago
@cu thanks for reporting this issue. The issue is that after creating the compartment and sending back the response, there is a time gap before the compartment actually exists in the identity server. We are aware of this and currently talking with the Identity team to resolve this issue. In the meantime, create_compartment_and_wait_for_state() will not work but a work around can be to call get_compartment and do a retry on 404s that come back. It would take maybe 1 second for the get_compartment request to return a 200
I am using the
oci
package version 2.80.0.I am trying to create a new compartment under my tenancy and decided to try with
create_compartment_and_wait_for_state()
since compartment creation is apparently not instantaneous.This is my code:
The compartment is actually created, but the call results in a traceback, exiting my script before it can print the results and I'm unable to determine what is wrong. It looks like an exception is being raised because the API is returning a 404 before the compartment is ready, but the whole point of this function is to keep trying anyway until it exists, no?
Full traceback: