|
|
|
|
@ -15,7 +15,7 @@ type FixerCommConfig struct{}
|
|
|
|
|
|
|
|
|
|
func (FixerCommConfig) DeprecatedOptions() map[string][]string {
|
|
|
|
|
return map[string][]string{
|
|
|
|
|
"*": []string{"ssh_host_port_min", "ssh_host_port_max",
|
|
|
|
|
"*": {"ssh_host_port_min", "ssh_host_port_max",
|
|
|
|
|
"ssh_skip_nat_mapping"},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -46,14 +46,9 @@ func (FixerCommConfig) Fix(input map[string]interface{}) (map[string]interface{}
|
|
|
|
|
|
|
|
|
|
// ssh_host_port_min to host_port_min
|
|
|
|
|
if _, ok := builders["host_port_min"]; ok {
|
|
|
|
|
|
|
|
|
|
// drop ssh_host_port_min if it is also included
|
|
|
|
|
if _, sshHostPortMinIncluded := builders["ssh_host_port_min"]; sshHostPortMinIncluded {
|
|
|
|
|
delete(builders, "ssh_host_port_min")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete(builders, "ssh_host_port_min")
|
|
|
|
|
} else if _, ok := builders["ssh_host_port_min"]; ok {
|
|
|
|
|
|
|
|
|
|
// replace ssh_host_port_min with host_port_min
|
|
|
|
|
sshHostPortMinRaw := builders["ssh_host_port_min"]
|
|
|
|
|
delete(builders, "ssh_host_port_min")
|
|
|
|
|
@ -62,31 +57,20 @@ func (FixerCommConfig) Fix(input map[string]interface{}) (map[string]interface{}
|
|
|
|
|
|
|
|
|
|
// ssh_host_port_max to host_port_max
|
|
|
|
|
if _, ok := builders["host_port_max"]; ok {
|
|
|
|
|
|
|
|
|
|
// drop ssh_host_port_max if it is also included
|
|
|
|
|
if _, sshHostPortMaxIncluded := builders["ssh_host_port_max"]; sshHostPortMaxIncluded {
|
|
|
|
|
delete(builders, "ssh_host_port_max")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete(builders, "ssh_host_port_max")
|
|
|
|
|
} else if _, ok := builders["ssh_host_port_max"]; ok {
|
|
|
|
|
|
|
|
|
|
// replace ssh_host_port_max with host_port_max
|
|
|
|
|
sshHostPortMaxRaw := builders["ssh_host_port_max"]
|
|
|
|
|
delete(builders, "ssh_host_port_max")
|
|
|
|
|
builders["host_port_max"] = sshHostPortMaxRaw
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ssh_skip_nat_mapping to skip_nat_mapping
|
|
|
|
|
if _, ok := builders["skip_nat_mapping"]; ok {
|
|
|
|
|
|
|
|
|
|
// drop ssh_skip_nat_mapping if it is also included
|
|
|
|
|
if _, sshSkipNatMappingIncluded := builders["ssh_skip_nat_mapping"]; sshSkipNatMappingIncluded {
|
|
|
|
|
delete(builders, "ssh_skip_nat_mapping")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
delete(builders, "ssh_skip_nat_mapping")
|
|
|
|
|
} else if _, ok := builders["ssh_skip_nat_mapping"]; ok {
|
|
|
|
|
|
|
|
|
|
// replace ssh_skip_nat_mapping with skip_nat_mapping
|
|
|
|
|
sshSkipNatMappingRaw := builders["ssh_skip_nat_mapping"]
|
|
|
|
|
sshSkipNatMappingBool, ok := sshSkipNatMappingRaw.(bool)
|
|
|
|
|
|