mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Modify resourcemanager API to be more consistent with compute API. (#1454)
This commit is contained in:
parent
a4079aec8a
commit
11c8a52d35
@ -63,7 +63,7 @@ func resourceGoogleFolderCreate(d *schema.ResourceData, meta interface{}) error
|
||||
return fmt.Errorf("Error creating folder '%s' in '%s': %s", displayName, parent, err)
|
||||
}
|
||||
|
||||
err = resourceManagerV2Beta1OperationWait(config, op, "creating folder")
|
||||
err = resourceManagerV2Beta1OperationWait(config.clientResourceManager, op, "creating folder")
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error creating folder '%s' in '%s': %s", displayName, parent, err)
|
||||
@ -132,7 +132,7 @@ func resourceGoogleFolderUpdate(d *schema.ResourceData, meta interface{}) error
|
||||
return fmt.Errorf("Error moving folder '%s' to '%s': %s", displayName, newParent, err)
|
||||
}
|
||||
|
||||
err = resourceManagerV2Beta1OperationWait(config, op, "move folder")
|
||||
err = resourceManagerV2Beta1OperationWait(config.clientResourceManager, op, "move folder")
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error moving folder '%s' to '%s': %s", displayName, newParent, err)
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ func resourceGoogleProjectCreate(d *schema.ResourceData, meta interface{}) error
|
||||
d.SetId(pid)
|
||||
|
||||
// Wait for the operation to complete
|
||||
waitErr := resourceManagerOperationWait(config, op, "project to create")
|
||||
waitErr := resourceManagerOperationWait(config.clientResourceManager, op, "project to create")
|
||||
if waitErr != nil {
|
||||
// The resource wasn't actually created
|
||||
d.SetId("")
|
||||
|
@ -37,13 +37,13 @@ func (w *ResourceManagerOperationWaiter) Conf() *resource.StateChangeConf {
|
||||
}
|
||||
}
|
||||
|
||||
func resourceManagerOperationWait(config *Config, op *cloudresourcemanager.Operation, activity string) error {
|
||||
return resourceManagerOperationWaitTime(config, op, activity, 4)
|
||||
func resourceManagerOperationWait(service *cloudresourcemanager.Service, op *cloudresourcemanager.Operation, activity string) error {
|
||||
return resourceManagerOperationWaitTime(service, op, activity, 4)
|
||||
}
|
||||
|
||||
func resourceManagerOperationWaitTime(config *Config, op *cloudresourcemanager.Operation, activity string, timeoutMin int) error {
|
||||
func resourceManagerOperationWaitTime(service *cloudresourcemanager.Service, op *cloudresourcemanager.Operation, activity string, timeoutMin int) error {
|
||||
w := &ResourceManagerOperationWaiter{
|
||||
Service: config.clientResourceManager,
|
||||
Service: service,
|
||||
Op: op,
|
||||
}
|
||||
|
||||
@ -64,16 +64,16 @@ func resourceManagerOperationWaitTime(config *Config, op *cloudresourcemanager.O
|
||||
return nil
|
||||
}
|
||||
|
||||
func resourceManagerV2Beta1OperationWait(config *Config, op *resourceManagerV2Beta1.Operation, activity string) error {
|
||||
return resourceManagerV2Beta1OperationWaitTime(config, op, activity, 4)
|
||||
func resourceManagerV2Beta1OperationWait(service *cloudresourcemanager.Service, op *resourceManagerV2Beta1.Operation, activity string) error {
|
||||
return resourceManagerV2Beta1OperationWaitTime(service, op, activity, 4)
|
||||
}
|
||||
|
||||
func resourceManagerV2Beta1OperationWaitTime(config *Config, op *resourceManagerV2Beta1.Operation, activity string, timeoutMin int) error {
|
||||
func resourceManagerV2Beta1OperationWaitTime(service *cloudresourcemanager.Service, op *resourceManagerV2Beta1.Operation, activity string, timeoutMin int) error {
|
||||
opV1 := &cloudresourcemanager.Operation{}
|
||||
err := Convert(op, opV1)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return resourceManagerOperationWaitTime(config, opV1, activity, timeoutMin)
|
||||
return resourceManagerOperationWaitTime(service, opV1, activity, timeoutMin)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user