@@ -483,15 +483,15 @@ resource "nsxt_policy_project" "test" {
483
483
`
484
484
485
485
func getBasicAttrMap (createFlow , includeT0GW bool ) map [string ]string {
486
- var attrMap map [string ]string
486
+ attrMap := make (map [string ]string )
487
+ baseMap := accTestPolicyProjectUpdateAttributes
487
488
if createFlow {
488
- attrMap = accTestPolicyProjectCreateAttributes
489
- } else {
490
- // do not pass short_id on update
491
- attrMap = make (map [string ]string )
492
- attrMap ["DisplayName" ] = accTestPolicyProjectUpdateAttributes ["DisplayName" ]
493
- attrMap ["Description" ] = accTestPolicyProjectUpdateAttributes ["Description" ]
489
+ baseMap = accTestPolicyProjectCreateAttributes
490
+ //do not pass short_id on update
491
+ attrMap ["ShortId" ] = baseMap ["ShortId" ]
494
492
}
493
+ attrMap ["DisplayName" ] = baseMap ["DisplayName" ]
494
+ attrMap ["Description" ] = baseMap ["Description" ]
495
495
if includeT0GW {
496
496
attrMap ["T0GwPath" ] = "data.nsxt_policy_tier0_gateway.test.path"
497
497
}
@@ -502,7 +502,7 @@ func getBasicAttrMap(createFlow, includeT0GW bool) map[string]string {
502
502
func testAccNsxtPolicyProjectTemplate410 (createFlow , includeT0GW bool ) string {
503
503
attrMap := getBasicAttrMap (createFlow , includeT0GW )
504
504
buffer := new (bytes.Buffer )
505
- tmpl , err := template .New ("testAaccNsxtPolicyProject " ).Parse (templateData )
505
+ tmpl , err := template .New ("testAccNsxtPolicyProjectTemplate410 " ).Parse (templateData )
506
506
if err != nil {
507
507
panic (err )
508
508
}
@@ -520,7 +520,7 @@ func testAccNsxtPolicyProjectTemplate411(createFlow, includeT0GW, includeExterna
520
520
}
521
521
attrMap ["SetIpBlockVisibility" ] = "true"
522
522
buffer := new (bytes.Buffer )
523
- tmpl , err := template .New ("testAaccNsxtPolicyProject " ).Parse (templateData )
523
+ tmpl , err := template .New ("testAccNsxtPolicyProjectTemplate411 " ).Parse (templateData )
524
524
if err != nil {
525
525
panic (err )
526
526
}
@@ -539,7 +539,7 @@ func testAccNsxtPolicyProjectTemplate420(createFlow, includeT0GW, includeExterna
539
539
attrMap ["SetIpBlockVisibility" ] = "true"
540
540
attrMap ["ActivateDefaultDfwRules" ] = strconv .FormatBool (activateDefaultDfwRules )
541
541
buffer := new (bytes.Buffer )
542
- tmpl , err := template .New ("testAaccNsxtPolicyProject " ).Parse (templateData )
542
+ tmpl , err := template .New ("testAccNsxtPolicyProjectTemplate420 " ).Parse (templateData )
543
543
if err != nil {
544
544
panic (err )
545
545
}
@@ -559,7 +559,7 @@ func testAccNsxtPolicyProjectTemplate900(createFlow, includeT0GW, includeExterna
559
559
attrMap ["ActivateDefaultDfwRules" ] = strconv .FormatBool (activateDefaultDfwRules )
560
560
attrMap ["ExternalTGWConnectionPath" ] = "nsxt_policy_gateway_connection.test_gw_conn.path"
561
561
buffer := new (bytes.Buffer )
562
- tmpl , err := template .New ("testAaccNsxtPolicyProject " ).Parse (templateData )
562
+ tmpl , err := template .New ("testAccNsxtPolicyProjectTemplate900 " ).Parse (templateData )
563
563
if err != nil {
564
564
panic (err )
565
565
}
0 commit comments