public override string getFileFromGuest(string srcpath, cancellableDateTime deadline) { if (deadline == null) { deadline = new cancellableDateTime(TimeSpan.FromMinutes(2)); } return(doWithRetryOnSomeExceptions(() => { return executor.tryGetFileFromGuestWithRes(srcpath); }, deadline, TimeSpan.FromSeconds(10))); }
public override string getFileFromGuest(string srcpath, cancellableDateTime deadline = null) { if (_executor == null) { throw new NotSupportedException(); } return(doWithRetryOnSomeExceptions(() => { return _executor.tryGetFileFromGuestWithRes(srcpath); }, deadline)); }
public executionResult getResultIfComplete() { // Read the return code last. We do this because there's no way in VMWare's guest tools specify file locking, so // we may see empty files before they have been written to. SMBExecutor.triedNetworkCallRes <string> returnCodeResultInfo = _host.tryGetFileFromGuestWithRes(_returnCodeFilename); SMBExecutor.triedNetworkCallRes <string> stdOutResultInfo = _host.tryGetFileFromGuestWithRes(_stdOutFilename); SMBExecutor.triedNetworkCallRes <string> stdErrResultInfo = _host.tryGetFileFromGuestWithRes(_stdErrFilename); if (returnCodeResultInfo.retryRequested || returnCodeResultInfo.error != null || stdOutResultInfo.retryRequested || stdOutResultInfo.error != null || stdErrResultInfo.retryRequested || stdErrResultInfo.error != null) { return(null); } int retCode = Int32.Parse(returnCodeResultInfo.res); string stdOut = stdOutResultInfo.res; string stdErr = stdErrResultInfo.res; return(new executionResult(stdOut, stdErr, retCode)); }