diff --git a/plugins/communicators/winrm/command_filter.rb b/plugins/communicators/winrm/command_filter.rb index 4b5e2ab5c..eb08631ce 100644 --- a/plugins/communicators/winrm/command_filter.rb +++ b/plugins/communicators/winrm/command_filter.rb @@ -12,7 +12,7 @@ module VagrantPlugins "rm", "test", "uname", - "which" + "which", ] # Filter the given Vagrant command to ensure compatibility with Windows diff --git a/plugins/communicators/winrm/command_filters/cat.rb b/plugins/communicators/winrm/command_filters/cat.rb index 5d9cf8e01..c32e408e2 100644 --- a/plugins/communicators/winrm/command_filters/cat.rb +++ b/plugins/communicators/winrm/command_filters/cat.rb @@ -1,10 +1,8 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - # Handles the special case of determining the guest OS using cat class Cat - def filter(command) # cat /etc/release | grep -i OmniOS # cat /etc/redhat-release @@ -19,9 +17,7 @@ module VagrantPlugins # grep command command.start_with?('cat /etc/') end - end - end end end diff --git a/plugins/communicators/winrm/command_filters/chmod.rb b/plugins/communicators/winrm/command_filters/chmod.rb index a336f5dd4..842e636c2 100644 --- a/plugins/communicators/winrm/command_filters/chmod.rb +++ b/plugins/communicators/winrm/command_filters/chmod.rb @@ -1,21 +1,17 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - - # Converts a *nix 'chmod' command to a PowerShell equivalent + # Converts a *nix 'chmod' command to a PowerShell equivalent (none) class Chmod - def filter(command) - # Not support on Windows, the communicator will skip this command + # Not supported on Windows, the communicator should skip this command '' end def accept?(command) command.start_with?('chmod ') end - end - end end end diff --git a/plugins/communicators/winrm/command_filters/chown.rb b/plugins/communicators/winrm/command_filters/chown.rb index 127731ff6..77d34bf10 100644 --- a/plugins/communicators/winrm/command_filters/chown.rb +++ b/plugins/communicators/winrm/command_filters/chown.rb @@ -1,21 +1,17 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - - # Converts a *nix 'chown' command to a PowerShell equivalent + # Converts a *nix 'chown' command to a PowerShell equivalent (none) class Chown - def filter(command) - # Not support on Windows, the communicator will skip this command + # Not supported on Windows, the communicator should skip this command '' end def accept?(command) command.start_with?('chown ') end - end - end end end diff --git a/plugins/communicators/winrm/command_filters/grep.rb b/plugins/communicators/winrm/command_filters/grep.rb index 96ce32ca6..ad091d9f3 100644 --- a/plugins/communicators/winrm/command_filters/grep.rb +++ b/plugins/communicators/winrm/command_filters/grep.rb @@ -1,8 +1,7 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - - # Converts a *nix 'grep' command to a PowerShell equivalent + # Converts a *nix 'grep' command to a PowerShell equivalent (none) class Grep def filter(command) @@ -18,9 +17,7 @@ module VagrantPlugins def accept?(command) command.start_with?('grep ') end - end - end end end \ No newline at end of file diff --git a/plugins/communicators/winrm/command_filters/rm.rb b/plugins/communicators/winrm/command_filters/rm.rb index a0078c83d..5c0dd4c2b 100644 --- a/plugins/communicators/winrm/command_filters/rm.rb +++ b/plugins/communicators/winrm/command_filters/rm.rb @@ -1,10 +1,8 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - # Converts a *nix 'rm' command to a PowerShell equivalent class Rm - def filter(command) # rm -Rf /some/dir # rm /some/dir @@ -20,9 +18,7 @@ module VagrantPlugins def accept?(command) command.start_with?('rm ') end - end - end end end diff --git a/plugins/communicators/winrm/command_filters/test.rb b/plugins/communicators/winrm/command_filters/test.rb index 23fddc8bf..256b79114 100644 --- a/plugins/communicators/winrm/command_filters/test.rb +++ b/plugins/communicators/winrm/command_filters/test.rb @@ -1,10 +1,8 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - # Converts a *nix 'test' command to a PowerShell equivalent class Test - def filter(command) # test -d /tmp/dir # test -f /tmp/afile @@ -28,7 +26,6 @@ module VagrantPlugins command.start_with?("test ") end - private def check_for_directory(path) @@ -60,9 +57,7 @@ module VagrantPlugins exit 1 EOH end - end - end end end diff --git a/plugins/communicators/winrm/command_filters/uname.rb b/plugins/communicators/winrm/command_filters/uname.rb index 4a8b0836d..b661accd0 100644 --- a/plugins/communicators/winrm/command_filters/uname.rb +++ b/plugins/communicators/winrm/command_filters/uname.rb @@ -1,10 +1,8 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - - # Converts a *nix 'uname' command to a PowerShell equivalent + # Converts a *nix 'uname' command to a PowerShell equivalent (none) class Uname - def filter(command) # uname -s | grep 'Darwin' # uname -s | grep VMkernel @@ -23,9 +21,7 @@ module VagrantPlugins def accept?(command) command.start_with?('uname ') end - end - end end end diff --git a/plugins/communicators/winrm/command_filters/which.rb b/plugins/communicators/winrm/command_filters/which.rb index cf046ca19..2cc23a993 100644 --- a/plugins/communicators/winrm/command_filters/which.rb +++ b/plugins/communicators/winrm/command_filters/which.rb @@ -1,10 +1,8 @@ module VagrantPlugins module CommunicatorWinRM module CommandFilters - # Converts a *nix 'which' command to a PowerShell equivalent class Which - def filter(command) executable = command.strip.split(/\s+/)[1] return <<-EOH @@ -18,9 +16,7 @@ module VagrantPlugins def accept?(command) command.start_with?('which ') end - end - end end end