update metadata before actual Update op

This commit is contained in:
Jon Perritt 2015-02-01 00:14:43 -07:00
parent 43564d1c5c
commit a5147f472b
1 changed files with 4 additions and 4 deletions

View File

@ -111,15 +111,15 @@ func resourceObjectStorageContainerV1Update(d *schema.ResourceData, meta interfa
ContentType: d.Get("content_type").(string), ContentType: d.Get("content_type").(string),
} }
if d.HasChange("metadata") {
updateOpts.Metadata = resourceContainerMetadataV2(d)
}
_, err = containers.Update(objectStorgeClient, d.Id(), updateOpts).Extract() _, err = containers.Update(objectStorgeClient, d.Id(), updateOpts).Extract()
if err != nil { if err != nil {
return fmt.Errorf("Error updating OpenStack container: %s", err) return fmt.Errorf("Error updating OpenStack container: %s", err)
} }
if d.HasChange("metadata") {
updateOpts.Metadata = resourceContainerMetadataV2(d)
}
return resourceObjectStorageContainerV1Read(d, meta) return resourceObjectStorageContainerV1Read(d, meta)
} }