From 10f04c90a55ae4907d68b6d9739ce58f346f9e9a Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 14 Aug 2015 12:01:58 +0100 Subject: [PATCH 1/3] 'terraform output' helptext spacing fixed --- command/output.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/command/output.go b/command/output.go index f0fb096dc..5c5ddc5b8 100644 --- a/command/output.go +++ b/command/output.go @@ -111,12 +111,12 @@ Usage: terraform output [options] [NAME] Options: -state=path Path to the state file to read. Defaults to - "terraform.tfstate". + "terraform.tfstate". -no-color If specified, output won't contain any color. -module=name If specified, returns the outputs for a - specific module + specific module ` return strings.TrimSpace(helpText) From 9596271b36bc70761651ac28ba77e1a232d89a79 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 14 Aug 2015 12:02:32 +0100 Subject: [PATCH 2/3] Code formatted via gofmt --- command/output.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/command/output.go b/command/output.go index 5c5ddc5b8..33e6b6fcf 100644 --- a/command/output.go +++ b/command/output.go @@ -76,13 +76,13 @@ func (c *OutputCommand) Run(args []string) int { if name == "" { ks := make([]string, 0, len(mod.Outputs)) for k, _ := range mod.Outputs { - ks = append(ks, k) + ks = append(ks, k) } sort.Strings(ks) for _, k := range ks { - v := mod.Outputs[k] - c.Ui.Output(fmt.Sprintf("%s = %s", k, v)) + v := mod.Outputs[k] + c.Ui.Output(fmt.Sprintf("%s = %s", k, v)) } return 0 } From 00ad41bf7d842cbc36a12ca16ba9941670becb8c Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 14 Aug 2015 12:06:06 +0100 Subject: [PATCH 3/3] google: Code formatted via gofmt --- builtin/providers/google/config.go | 7 ++--- builtin/providers/google/operation.go | 3 +- builtin/providers/google/provider.go | 30 +++++++++---------- .../google/resource_compute_autoscaler.go | 6 ++-- .../resource_compute_autoscaler_test.go | 2 +- ...resource_compute_instance_group_manager.go | 4 +-- ...rce_compute_instance_group_manager_test.go | 1 - 7 files changed, 25 insertions(+), 28 deletions(-) diff --git a/builtin/providers/google/config.go b/builtin/providers/google/config.go index 838966528..6bfa3553d 100644 --- a/builtin/providers/google/config.go +++ b/builtin/providers/google/config.go @@ -10,7 +10,6 @@ import ( "runtime" "strings" - // TODO(dcunnin): Use version code from version.go // "github.com/hashicorp/terraform" "golang.org/x/oauth2" @@ -29,10 +28,10 @@ type Config struct { Project string Region string - clientCompute *compute.Service + clientCompute *compute.Service clientContainer *container.Service - clientDns *dns.Service - clientStorage *storage.Service + clientDns *dns.Service + clientStorage *storage.Service } func (c *Config) loadAndValidate() error { diff --git a/builtin/providers/google/operation.go b/builtin/providers/google/operation.go index aef4576c4..fb79703c6 100644 --- a/builtin/providers/google/operation.go +++ b/builtin/providers/google/operation.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "google.golang.org/api/compute/v1" "github.com/hashicorp/terraform/helper/resource" + "google.golang.org/api/compute/v1" ) // OperationWaitType is an enum specifying what type of operation @@ -77,4 +77,3 @@ func (e OperationError) Error() string { return buf.String() } - diff --git a/builtin/providers/google/provider.go b/builtin/providers/google/provider.go index 6dade8dea..690ec7e20 100644 --- a/builtin/providers/google/provider.go +++ b/builtin/providers/google/provider.go @@ -34,22 +34,22 @@ func Provider() terraform.ResourceProvider { }, ResourcesMap: map[string]*schema.Resource{ - "google_compute_autoscaler": resourceComputeAutoscaler(), - "google_compute_address": resourceComputeAddress(), - "google_compute_disk": resourceComputeDisk(), - "google_compute_firewall": resourceComputeFirewall(), - "google_compute_forwarding_rule": resourceComputeForwardingRule(), - "google_compute_http_health_check": resourceComputeHttpHealthCheck(), - "google_compute_instance": resourceComputeInstance(), - "google_compute_instance_template": resourceComputeInstanceTemplate(), - "google_compute_network": resourceComputeNetwork(), - "google_compute_route": resourceComputeRoute(), - "google_compute_target_pool": resourceComputeTargetPool(), - "google_container_cluster": resourceContainerCluster(), - "google_dns_managed_zone": resourceDnsManagedZone(), - "google_dns_record_set": resourceDnsRecordSet(), + "google_compute_autoscaler": resourceComputeAutoscaler(), + "google_compute_address": resourceComputeAddress(), + "google_compute_disk": resourceComputeDisk(), + "google_compute_firewall": resourceComputeFirewall(), + "google_compute_forwarding_rule": resourceComputeForwardingRule(), + "google_compute_http_health_check": resourceComputeHttpHealthCheck(), + "google_compute_instance": resourceComputeInstance(), + "google_compute_instance_template": resourceComputeInstanceTemplate(), + "google_compute_network": resourceComputeNetwork(), + "google_compute_route": resourceComputeRoute(), + "google_compute_target_pool": resourceComputeTargetPool(), + "google_container_cluster": resourceContainerCluster(), + "google_dns_managed_zone": resourceDnsManagedZone(), + "google_dns_record_set": resourceDnsRecordSet(), "google_compute_instance_group_manager": resourceComputeInstanceGroupManager(), - "google_storage_bucket": resourceStorageBucket(), + "google_storage_bucket": resourceStorageBucket(), }, ConfigureFunc: providerConfigure, diff --git a/builtin/providers/google/resource_compute_autoscaler.go b/builtin/providers/google/resource_compute_autoscaler.go index 35c8167ff..10b7c84ef 100644 --- a/builtin/providers/google/resource_compute_autoscaler.go +++ b/builtin/providers/google/resource_compute_autoscaler.go @@ -5,9 +5,9 @@ import ( "log" "time" - "google.golang.org/api/googleapi" - "google.golang.org/api/compute/v1" "github.com/hashicorp/terraform/helper/schema" + "google.golang.org/api/compute/v1" + "google.golang.org/api/googleapi" ) func resourceComputeAutoscaler() *schema.Resource { @@ -52,7 +52,7 @@ func resourceComputeAutoscaler() *schema.Resource { "cooldown_period": &schema.Schema{ Type: schema.TypeInt, Optional: true, - Default: 60, + Default: 60, }, "cpu_utilization": &schema.Schema{ diff --git a/builtin/providers/google/resource_compute_autoscaler_test.go b/builtin/providers/google/resource_compute_autoscaler_test.go index fbc900510..7dba5520d 100644 --- a/builtin/providers/google/resource_compute_autoscaler_test.go +++ b/builtin/providers/google/resource_compute_autoscaler_test.go @@ -4,9 +4,9 @@ import ( "fmt" "testing" - "google.golang.org/api/compute/v1" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" + "google.golang.org/api/compute/v1" ) func TestAccAutoscaler_basic(t *testing.T) { diff --git a/builtin/providers/google/resource_compute_instance_group_manager.go b/builtin/providers/google/resource_compute_instance_group_manager.go index aea911001..9651c935f 100644 --- a/builtin/providers/google/resource_compute_instance_group_manager.go +++ b/builtin/providers/google/resource_compute_instance_group_manager.go @@ -5,8 +5,8 @@ import ( "log" "time" - "google.golang.org/api/googleapi" "google.golang.org/api/compute/v1" + "google.golang.org/api/googleapi" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" @@ -116,7 +116,7 @@ func resourceComputeInstanceGroupManagerCreate(d *schema.ResourceData, meta inte Name: d.Get("name").(string), BaseInstanceName: d.Get("base_instance_name").(string), InstanceTemplate: d.Get("instance_template").(string), - TargetSize: target_size, + TargetSize: target_size, } // Set optional fields diff --git a/builtin/providers/google/resource_compute_instance_group_manager_test.go b/builtin/providers/google/resource_compute_instance_group_manager_test.go index ffbd89ac4..4d5bd7c13 100644 --- a/builtin/providers/google/resource_compute_instance_group_manager_test.go +++ b/builtin/providers/google/resource_compute_instance_group_manager_test.go @@ -307,4 +307,3 @@ resource "google_compute_instance_group_manager" "igm-update" { zone = "us-central1-c" target_size = 3 }` -