protected override void Run()
{
host.Status = HostStatus.compiling;
string hostname = Helpers.GetName(host.Host);
hostname = ZipStatusReportAction.SanitizeTarPathMember(hostname);
// Workaround for excessively long filenames: trim the hostname we use
if (hostname.Length > 20)
{
hostname = hostname.Truncate(20);
}
string filename = string.Format("{1}\\{2}-bugtool-{0}.tar", hostname, filepath, timestring);
string entries_string = String.Join(",", entries);
log.DebugFormat("Getting system status for {0} on {1}", entries_string, hostname);
try
{
host.Status = HostStatus.compiling;
if (Session == null)
{
throw new Exception(Messages.CONNECTION_IO_EXCEPTION);
}
HTTPHelper.Get(this, false, dataRxDelegate, filename, host.Host.address,
(HTTP_actions.get_ssss)HTTP_actions.get_system_status,
Session.opaque_ref, entries_string, "tar");
log.DebugFormat("Getting system status from {0} successful", hostname);
host.Status = HostStatus.succeeded;
base.PercentComplete = 100;
}
catch (CancelledException ce)
{
log.Info("Getting system status cancelled");
Description = Messages.ACTION_SYSTEM_STATUS_CANCELLED;
host.Status = HostStatus.failed;
host.error = ce;
throw;
}
catch (Exception e)
{
log.Warn(string.Format("Getting system status from {0} failed", hostname), e);
host.Status = HostStatus.failed;
host.error = e;
Description =
Win32.GetHResult(e) == Win32.ERROR_DISK_FULL ?
Messages.ACTION_SYSTEM_STATUS_DISK_FULL :
Messages.ACTION_SYSTEM_STATUS_FAILED;
}
}