allow shell plugin to affect remote module filename

Fix for 13368, added get_remote_filename to shell plugins, powershell version appends .ps1 if necessary, base shell plugin no-ops
This commit is contained in:
nitzmahone 2015-12-01 13:39:02 -08:00
parent f873cc0fb5
commit c94509f273
4 changed files with 13 additions and 6 deletions

View file

@ -301,11 +301,6 @@ class Connection(ConnectionBase):
}}
'''
# FUTURE: this sucks- why can't the module/shell stuff do this?
with open(in_path, 'r') as temp_file:
if temp_file.read(15).lower().startswith('#!powershell') and not out_path.lower().endswith('.ps1'):
out_path = out_path + '.ps1'
script = script_template.format(self._shell._escape(out_path))
cmd_parts = self._shell._encode_script(script, as_list=True, strict_mode=False)