From 1a4c309ad5af8f56c445ea7eeb244ffbd2928440 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Tue, 5 Sep 2017 18:09:31 -0700 Subject: [PATCH] namespace the enhanced networking fixer appropriately. --- fix/fixer.go | 28 +++++++++---------- ...go => fixer_amazon_enhanced_networking.go} | 8 +++--- ... fixer_amazon_enhanced_networking_test.go} | 8 +++--- 3 files changed, 22 insertions(+), 22 deletions(-) rename fix/{fixer_enhanced_networking.go => fixer_amazon_enhanced_networking.go} (75%) rename fix/{fixer_enhanced_networking_test.go => fixer_amazon_enhanced_networking_test.go} (83%) diff --git a/fix/fixer.go b/fix/fixer.go index 0f094c8c1..938a7160f 100644 --- a/fix/fixer.go +++ b/fix/fixer.go @@ -20,19 +20,19 @@ var FixerOrder []string func init() { Fixers = map[string]Fixer{ - "iso-md5": new(FixerISOMD5), - "createtime": new(FixerCreateTime), - "pp-vagrant-override": new(FixerVagrantPPOverride), - "virtualbox-gaattach": new(FixerVirtualBoxGAAttach), - "virtualbox-rename": new(FixerVirtualBoxRename), - "vmware-rename": new(FixerVMwareRename), - "parallels-headless": new(FixerParallelsHeadless), - "parallels-deprecations": new(FixerParallelsDeprecations), - "sshkeypath": new(FixerSSHKeyPath), - "sshdisableagent": new(FixerSSHDisableAgent), - "manifest-filename": new(FixerManifestFilename), - "amazon-shutdown_behavior": new(FixerAmazonShutdownBehavior), - "enhanced-networking": new(FixerEnhancedNetworking), + "iso-md5": new(FixerISOMD5), + "createtime": new(FixerCreateTime), + "pp-vagrant-override": new(FixerVagrantPPOverride), + "virtualbox-gaattach": new(FixerVirtualBoxGAAttach), + "virtualbox-rename": new(FixerVirtualBoxRename), + "vmware-rename": new(FixerVMwareRename), + "parallels-headless": new(FixerParallelsHeadless), + "parallels-deprecations": new(FixerParallelsDeprecations), + "sshkeypath": new(FixerSSHKeyPath), + "sshdisableagent": new(FixerSSHDisableAgent), + "manifest-filename": new(FixerManifestFilename), + "amazon-shutdown_behavior": new(FixerAmazonShutdownBehavior), + "amazon-enhanced-networking": new(FixerAmazonEnhancedNetworking), } FixerOrder = []string{ @@ -48,6 +48,6 @@ func init() { "sshdisableagent", "manifest-filename", "amazon-shutdown_behavior", - "enhanced-networking", + "amazon-enhanced-networking", } } diff --git a/fix/fixer_enhanced_networking.go b/fix/fixer_amazon_enhanced_networking.go similarity index 75% rename from fix/fixer_enhanced_networking.go rename to fix/fixer_amazon_enhanced_networking.go index be19cb47d..4c9330ebe 100644 --- a/fix/fixer_enhanced_networking.go +++ b/fix/fixer_amazon_enhanced_networking.go @@ -4,11 +4,11 @@ import ( "github.com/mitchellh/mapstructure" ) -// FixerEnhancedNetworking is a Fixer that replaces the "enhanced_networking" configuration key +// FixerAmazonEnhancedNetworking is a Fixer that replaces the "enhanced_networking" configuration key // with the clearer "ena_support". This disambiguates ena_support from sriov_support. -type FixerEnhancedNetworking struct{} +type FixerAmazonEnhancedNetworking struct{} -func (FixerEnhancedNetworking) Fix(input map[string]interface{}) (map[string]interface{}, error) { +func (FixerAmazonEnhancedNetworking) Fix(input map[string]interface{}) (map[string]interface{}, error) { // Our template type we'll use for this fixer only type template struct { Builders []map[string]interface{} @@ -40,6 +40,6 @@ func (FixerEnhancedNetworking) Fix(input map[string]interface{}) (map[string]int return input, nil } -func (FixerEnhancedNetworking) Synopsis() string { +func (FixerAmazonEnhancedNetworking) Synopsis() string { return `Replaces "enhanced_networking" in builders with "ena_support"` } diff --git a/fix/fixer_enhanced_networking_test.go b/fix/fixer_amazon_enhanced_networking_test.go similarity index 83% rename from fix/fixer_enhanced_networking_test.go rename to fix/fixer_amazon_enhanced_networking_test.go index 589aaa680..f8b5be178 100644 --- a/fix/fixer_enhanced_networking_test.go +++ b/fix/fixer_amazon_enhanced_networking_test.go @@ -5,11 +5,11 @@ import ( "testing" ) -func TestFixerEnhancedNetworking_Impl(t *testing.T) { - var _ Fixer = new(FixerEnhancedNetworking) +func TestFixerAmazonEnhancedNetworking_Impl(t *testing.T) { + var _ Fixer = new(FixerAmazonEnhancedNetworking) } -func TestFixerEnhancedNetworking(t *testing.T) { +func TestFixerAmazonEnhancedNetworking(t *testing.T) { cases := []struct { Input map[string]interface{} Expected map[string]interface{} @@ -42,7 +42,7 @@ func TestFixerEnhancedNetworking(t *testing.T) { } for _, tc := range cases { - var f FixerEnhancedNetworking + var f FixerAmazonEnhancedNetworking input := map[string]interface{}{ "builders": []map[string]interface{}{tc.Input},