def _sshCmd(self, cmd, throwOnError=True, **kwargs): ret = sshCmd(cmd, self.vmAddress, sshKey=self.userPrivateKeyFile, verboseLevel=self.verboseLevel, verboseThreshold=Util.VERBOSE_LEVEL_DETAILED, **kwargs) if ret and throwOnError: raise ExecutionException('Error executing command: %s' % cmd) return ret
def _nodeShell(self, command, **kwargs): stdout = kwargs.get('stdout', self.stdout) stderr = kwargs.get('stderr', self.stderr) if kwargs.has_key('stdout'): del kwargs['stdout'] if kwargs.has_key('stderr'): del kwargs['stderr'] if isinstance(command, list): command = ' '.join(command) return sshCmd(command, self.nodeAddr, sshKey=self.nodePrivateKey, stdout=stdout, stderr=stderr, verboseLevel=self.verboseLevel, verboseThreshold=Util.VERBOSE_LEVEL_DETAILED, **kwargs)