Skip to content

Commit

Permalink
make use of utils.String where applicable and removed name from dsc c…
Browse files Browse the repository at this point in the history
…onfiguration
  • Loading branch information
bgelens committed Sep 9, 2018
1 parent f192327 commit 872517e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 6 additions & 7 deletions azurerm/resource_arm_automation_dsc_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ func resourceArmAutomationDscConfigurationCreateUpdate(d *schema.ResourceData, m
parameters := automation.DscConfigurationCreateOrUpdateParameters{
DscConfigurationCreateOrUpdateProperties: &automation.DscConfigurationCreateOrUpdateProperties{
LogVerbose: utils.Bool(logVerbose),
Description: &description,
Description: utils.String(description),
Source: &automation.ContentSource{
Type: automation.EmbeddedContent,
Value: &contentEmbedded,
Value: utils.String(contentEmbedded),
},
},
Location: &location,
Name: &name,
Location: utils.String(location),
}

_, err := client.CreateOrUpdate(ctx, resGroup, accName, name, parameters)
Expand Down Expand Up @@ -152,9 +151,9 @@ func resourceArmAutomationDscConfigurationRead(d *schema.ResourceData, meta inte
d.Set("state", resp.State)
}

contentresp, contenterr := client.GetContent(ctx, resGroup, accName, name)
if contenterr != nil {
return fmt.Errorf("Error making Read request on AzureRM Automation Dsc Configuration content %q: %+v", name, contenterr)
contentresp, err := client.GetContent(ctx, resGroup, accName, name)
if err != nil {
return fmt.Errorf("Error making Read request on AzureRM Automation Dsc Configuration content %q: %+v", name, err)
}

buf := new(bytes.Buffer)
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_automation_dsc_nodeconfiguration.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ func resourceArmAutomationDscNodeConfigurationCreateUpdate(d *schema.ResourceDat
parameters := automation.DscNodeConfigurationCreateOrUpdateParameters{
Source: &automation.ContentSource{
Type: automation.EmbeddedContent,
Value: &content,
Value: utils.String(content),
},
Configuration: &automation.DscConfigurationAssociationProperty{
Name: &configurationName,
Name: utils.String(configurationName),
},
Name: &name,
Name: utils.String(name),
}

_, err := client.CreateOrUpdate(ctx, resGroup, accName, name, parameters)
Expand Down

0 comments on commit 872517e

Please sign in to comment.