From 32e1a32476836d86c232e0a0543300c4dd96e2e5 Mon Sep 17 00:00:00 2001 From: Paul Stack Date: Fri, 10 Jun 2016 20:04:40 +0200 Subject: [PATCH] remote: Rename mas to azure (#7114) MAS wasn't obvious it was Azure so renamed it to Azure --- state/remote/{mas.go => azure.go} | 12 +-- state/remote/{mas_test.go => azure_test.go} | 12 +-- state/remote/remote.go | 2 +- .../remote/{mas.html.md => azure.html.md} | 10 +-- website/source/layouts/remotestate.erb | 84 +++++++++---------- 5 files changed, 60 insertions(+), 60 deletions(-) rename state/remote/{mas.go => azure.go} (94%) rename state/remote/{mas_test.go => azure_test.go} (93%) rename website/source/docs/state/remote/{mas.html.md => azure.html.md} (93%) diff --git a/state/remote/mas.go b/state/remote/azure.go similarity index 94% rename from state/remote/mas.go rename to state/remote/azure.go index 7dcf7fb67..002c75ce3 100644 --- a/state/remote/mas.go +++ b/state/remote/azure.go @@ -12,7 +12,7 @@ import ( riviera "github.com/jen20/riviera/azure" ) -func masFactory(conf map[string]string) (Client, error) { +func azureFactory(conf map[string]string) (Client, error) { storageAccountName, ok := conf["storage_account_name"] if !ok { return nil, fmt.Errorf("missing 'storage_account_name' configuration") @@ -47,7 +47,7 @@ func masFactory(conf map[string]string) (Client, error) { blobClient := storageClient.GetBlobService() - return &MASClient{ + return &AzureClient{ blobClient: &blobClient, containerName: containerName, keyName: keyName, @@ -125,13 +125,13 @@ func confOrEnv(conf map[string]string, confKey, envVar string) (string, bool) { return value, value != "" } -type MASClient struct { +type AzureClient struct { blobClient *mainStorage.BlobStorageClient containerName string keyName string } -func (c *MASClient) Get() (*Payload, error) { +func (c *AzureClient) Get() (*Payload, error) { blob, err := c.blobClient.GetBlob(c.containerName, c.keyName) if err != nil { if storErr, ok := err.(mainStorage.AzureStorageServiceError); ok { @@ -161,7 +161,7 @@ func (c *MASClient) Get() (*Payload, error) { return payload, nil } -func (c *MASClient) Put(data []byte) error { +func (c *AzureClient) Put(data []byte) error { return c.blobClient.CreateBlockBlobFromReader( c.containerName, c.keyName, @@ -173,6 +173,6 @@ func (c *MASClient) Put(data []byte) error { ) } -func (c *MASClient) Delete() error { +func (c *AzureClient) Delete() error { return c.blobClient.DeleteBlob(c.containerName, c.keyName, nil) } diff --git a/state/remote/mas_test.go b/state/remote/azure_test.go similarity index 93% rename from state/remote/mas_test.go rename to state/remote/azure_test.go index 696f327d9..7680bfbb7 100644 --- a/state/remote/mas_test.go +++ b/state/remote/azure_test.go @@ -12,13 +12,13 @@ import ( "github.com/jen20/riviera/storage" ) -func TestMASClient_impl(t *testing.T) { - var _ Client = new(MASClient) +func TestAzureClient_impl(t *testing.T) { + var _ Client = new(AzureClient) } -func TestMASClient(t *testing.T) { - // This test creates a bucket in MAS and populates it. - // It may incur costs, so it will only run if MAS credential environment +func TestAzureClient(t *testing.T) { + // This test creates a bucket in Azure and populates it. + // It may incur costs, so it will only run if Azure credential environment // variables are present. config := map[string]string{ @@ -42,7 +42,7 @@ func TestMASClient(t *testing.T) { setup(t, config) defer teardown(t, config) - client, err := masFactory(config) + client, err := azureFactory(config) if err != nil { t.Fatalf("Error for valid config: %v", err) } diff --git a/state/remote/remote.go b/state/remote/remote.go index 9c54cc9dc..fdec41bcc 100644 --- a/state/remote/remote.go +++ b/state/remote/remote.go @@ -37,11 +37,11 @@ func NewClient(t string, conf map[string]string) (Client, error) { // NewClient. var BuiltinClients = map[string]Factory{ "atlas": atlasFactory, + "azure": azureFactory, "consul": consulFactory, "etcd": etcdFactory, "gcs": gcsFactory, "http": httpFactory, - "mas": masFactory, "s3": s3Factory, "swift": swiftFactory, "artifactory": artifactoryFactory, diff --git a/website/source/docs/state/remote/mas.html.md b/website/source/docs/state/remote/azure.html.md similarity index 93% rename from website/source/docs/state/remote/mas.html.md rename to website/source/docs/state/remote/azure.html.md index f1cef36f2..6e8b908a6 100644 --- a/website/source/docs/state/remote/mas.html.md +++ b/website/source/docs/state/remote/azure.html.md @@ -1,12 +1,12 @@ --- layout: "remotestate" -page_title: "Remote State Backend: mas" -sidebar_current: "docs-state-remote-mas" +page_title: "Remote State Backend: azure" +sidebar_current: "docs-state-remote-azure" description: |- Terraform can store the state remotely, making it easier to version and work with in a team. --- -# mas +# azure Stores the state as a given key in a given bucket on [Microsoft Azure Storage](https://azure.microsoft.com/en-us/documentation/articles/storage-introduction/). @@ -18,7 +18,7 @@ Use of environment variables or config file is recommended. ``` terraform remote config \ - -backend=mas \ + -backend=azure \ -backend-config="storage_account_name=terraform123abc" \ -backend-config="container_name=terraform-state" \ -backend-config="key=prod.terraform.tfstate" @@ -29,7 +29,7 @@ terraform remote config \ ```hcl # setup remote state data source data "terraform_remote_state" "foo" { - backend = "mas" + backend = "azure" config { storage_account_name = "terraform123abc" container_name = "terraform-state" diff --git a/website/source/layouts/remotestate.erb b/website/source/layouts/remotestate.erb index 2b00b6259..cd14b9d77 100644 --- a/website/source/layouts/remotestate.erb +++ b/website/source/layouts/remotestate.erb @@ -1,49 +1,49 @@ <% wrap_layout :inner do %> <% content_for :sidebar do %> - <% end %> <%= yield %>