mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Use false/true instead of 0/1 for bool
This commit is contained in:
parent
21cd620ef9
commit
202ed9c680
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -171,12 +172,7 @@ func resourceArmTemplateDeploymentRead(d *schema.ResourceData, meta interface{})
|
|||||||
var outputValueString string
|
var outputValueString string
|
||||||
switch strings.ToLower(outputType.(string)) {
|
switch strings.ToLower(outputType.(string)) {
|
||||||
case "bool":
|
case "bool":
|
||||||
// Use explicit "0"/"1" strings for boolean
|
outputValueString = strconv.FormatBool(outputValue.(bool))
|
||||||
if outputValue.(bool) {
|
|
||||||
outputValueString = "1"
|
|
||||||
} else {
|
|
||||||
outputValueString = "0"
|
|
||||||
}
|
|
||||||
|
|
||||||
case "string":
|
case "string":
|
||||||
outputValueString = outputValue.(string)
|
outputValueString = outputValue.(string)
|
||||||
|
@ -82,8 +82,8 @@ func TestAccAzureRMTemplateDeployment_withOutputs(t *testing.T) {
|
|||||||
testCheckAzureRMTemplateDeploymentExists("azurerm_template_deployment.test"),
|
testCheckAzureRMTemplateDeploymentExists("azurerm_template_deployment.test"),
|
||||||
resource.TestCheckOutput("tfIntOutput", "-123"),
|
resource.TestCheckOutput("tfIntOutput", "-123"),
|
||||||
resource.TestCheckOutput("tfStringOutput", "Standard_GRS"),
|
resource.TestCheckOutput("tfStringOutput", "Standard_GRS"),
|
||||||
resource.TestCheckOutput("tfFalseOutput", "0"),
|
resource.TestCheckOutput("tfFalseOutput", "false"),
|
||||||
resource.TestCheckOutput("tfTrueOutput", "1"),
|
resource.TestCheckOutput("tfTrueOutput", "true"),
|
||||||
resource.TestCheckResourceAttr("azurerm_template_deployment.test", "outputs.stringOutput", "Standard_GRS"),
|
resource.TestCheckResourceAttr("azurerm_template_deployment.test", "outputs.stringOutput", "Standard_GRS"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user