def _uploadScript(script): scriptName, args = __tellScriptNameAndArgs(script) scriptDirectory = Util.sanitizePath(os.path.dirname(script)) scriptPathLocal = os.path.abspath(os.path.join(scriptDirectory, scriptName)) scriptPathRemote = '/tmp/%s' % scriptName rc, output = self._scpWithOutput(scriptPathLocal, 'root@%s:%s' % (self.vmAddress, scriptPathRemote)) if rc != 0: self._printError('An error occurred while uploading script %s\n%s' % (script, output)) self._sshCmdWithOutput('chmod 0755 %s' % scriptPathRemote) return scriptPathRemote, args