def _uploadAndExecuteRemoteScript(self, script):

        def __tellScriptNameAndArgs(script):
            scriptNameAndArgs = os.path.basename(script)
            scriptNameAndArgsList = scriptNameAndArgs.split(' ', 1)
            if len(scriptNameAndArgsList) == 1:  # no arguments given
                scriptNameAndArgsList = scriptNameAndArgsList + ['']
            return scriptNameAndArgsList

        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

        def _executeRemoteScript(scriptPathRemote, args=''):
            rc = self._sshCmd('%s %s' % (scriptPathRemote, args), throwOnError=False,
                              pseudoTTY=True)
            if rc != 0:
                self._printError('An error occurred while executing script %s' % script)

        scriptPathRemote, args = _uploadScript(script)
        _executeRemoteScript(scriptPathRemote, args)