Skip to content

Commit

Permalink
Fix coding styles according to the reviews.
Browse files Browse the repository at this point in the history
  • Loading branch information
Junyi Yi committed Jun 1, 2018
1 parent da7b3a5 commit 7e6daf7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions azurerm/resource_arm_storage_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ func resourceArmStorageBlobUpdate(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error getting storage account %s: %+v", storageAccountName, err)
}
if !accountExists {
return fmt.Errorf("Storage account %s not found", storageAccountName)
return fmt.Errorf("Storage account %s not found in resource group %s", storageAccountName, resourceGroupName)
}

name := d.Get("name").(string)
Expand All @@ -560,7 +560,8 @@ func resourceArmStorageBlobUpdate(d *schema.ResourceData, meta interface{}) erro
blob.Properties.ContentType = d.Get("content_type").(string)
}

err = blob.SetProperties(nil)
options := &storage.SetBlobPropertiesOptions{}
err = blob.SetProperties(options)
if err != nil {
return fmt.Errorf("Error setting properties of blob %s (container %s, storage account %s): %+v", name, storageContainerName, storageAccountName, err)
}
Expand Down Expand Up @@ -601,7 +602,8 @@ func resourceArmStorageBlobRead(d *schema.ResourceData, meta interface{}) error
container := blobClient.GetContainerReference(storageContainerName)
blob := container.GetBlobReference(name)

err = blob.GetProperties(nil)
options := &storage.GetBlobPropertiesOptions{}
err = blob.GetProperties(options)
if err != nil {
return fmt.Errorf("Error getting properties of blob %s (container %s, storage account %s): %+v", name, storageContainerName, storageAccountName, err)
}
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_storage_blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ func TestAccAzureRMStorageBlobBlock_blockContentType(t *testing.T) {
t.Fatalf("Failed to close source blob")
}

config := testAccAzureRMStorageBlobPage_blockContentType(ri, rs1, sourceBlob.Name(), testLocation(), "text/plain")
updateConfig := testAccAzureRMStorageBlobPage_blockContentType(ri, rs1, sourceBlob.Name(), testLocation(), "text/vnd.terraform.acctest.tmpfile")
config := testAccAzureRMStorageBlobPage_blockContentType(ri, rs1, testLocation(), sourceBlob.Name(), "text/plain")
updateConfig := testAccAzureRMStorageBlobPage_blockContentType(ri, rs1, testLocation(), sourceBlob.Name(), "text/vnd.terraform.acctest.tmpfile")

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Expand Down Expand Up @@ -712,7 +712,7 @@ resource "azurerm_storage_blob" "destination" {
`, rInt, location, rString, sourceBlobName)
}

func testAccAzureRMStorageBlobPage_blockContentType(rInt int, rString, sourceBlobName, location, contentType string) string {
func testAccAzureRMStorageBlobPage_blockContentType(rInt int, rString, location string, sourceBlobName, contentType string) string {
return fmt.Sprintf(`
resource "azurerm_resource_group" "test" {
name = "acctestRG-%d"
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/storage_blob.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ The following arguments are supported:

* `size` - (Optional) Used only for `page` blobs to specify the size in bytes of the blob to be created. Must be a multiple of 512. Defaults to 0.

* `content_type` - (Optional) The content type of the storage blob. Cannot be defined if `source_uri` is defined. Defaults to `application/octet-stream`.

* `source` - (Optional) An absolute path to a file on the local system. Cannot be defined if `source_uri` is defined.

* `source_uri` - (Optional) The URI of an existing blob, or a file in the Azure File service, to use as the source contents
Expand Down

0 comments on commit 7e6daf7

Please sign in to comment.