Fix typographical errors in the fixers
This commit is contained in:
parent
f07e4214cc
commit
22504200cc
|
@ -19,7 +19,7 @@ func (FixerAmazonTemporarySecurityCIDRs) Fix(input map[string]interface{}) (map[
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go through each builder and replace the temporary_security_group_cidr if we can
|
// Go through each builder and replace the temporary_security_group_source_cidr if we can
|
||||||
for _, builder := range tpl.Builders {
|
for _, builder := range tpl.Builders {
|
||||||
builderTypeRaw, ok := builder["type"]
|
builderTypeRaw, ok := builder["type"]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -35,13 +35,13 @@ func (FixerAmazonTemporarySecurityCIDRs) Fix(input map[string]interface{}) (map[
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
temporarySecurityGroupCIDR, ok := builder["temporary_security_group_cidr"].(string)
|
temporarySecurityGroupCIDR, ok := builder["temporary_security_group_source_cidr"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
delete(builder, "temporary_security_group_cidr")
|
delete(builder, "temporary_security_group_source_cidr")
|
||||||
builder["temporary_security_group_cidrs"] = []string{temporarySecurityGroupCIDR}
|
builder["temporary_security_group_source_cidrs"] = []string{temporarySecurityGroupCIDR}
|
||||||
}
|
}
|
||||||
|
|
||||||
input["builders"] = tpl.Builders
|
input["builders"] = tpl.Builders
|
||||||
|
@ -49,5 +49,5 @@ func (FixerAmazonTemporarySecurityCIDRs) Fix(input map[string]interface{}) (map[
|
||||||
}
|
}
|
||||||
|
|
||||||
func (FixerAmazonTemporarySecurityCIDRs) Synopsis() string {
|
func (FixerAmazonTemporarySecurityCIDRs) Synopsis() string {
|
||||||
return `Replaces "temporary_security_group_cidr" (string) with "temporary_security_group_cidrs" (list of strings)`
|
return `Replaces "temporary_security_group_source_cidr" (string) with "temporary_security_group_source_cidrs" (list of strings)`
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,13 @@ func TestFixerAmazonTemporarySecurityCIDRs(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
Input: map[string]interface{}{
|
Input: map[string]interface{}{
|
||||||
"type": "amazon-ebs",
|
"type": "amazon-ebs",
|
||||||
"temporary_security_group_cidr": "0.0.0.0/0",
|
"temporary_security_group_source_cidr": "0.0.0.0/0",
|
||||||
},
|
},
|
||||||
|
|
||||||
Expected: map[string]interface{}{
|
Expected: map[string]interface{}{
|
||||||
"type": "amazon-ebs",
|
"type": "amazon-ebs",
|
||||||
"temporary_security_group_cidrs": []string{"0.0.0.0/0"},
|
"temporary_security_group_source_cidrs": []string{"0.0.0.0/0"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue