Skip to content
Snippets Groups Projects
Commit ae4cb0e8 authored by Edward Moyse's avatar Edward Moyse
Browse files

Merge branch 'sh_xrd_warning' into 'master'

introduce debug messages for DiskListXRD

See merge request !49616
parents e3e26fd0 4e00706c
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!49616introduce debug messages for DiskListXRD
......@@ -22,6 +22,7 @@
#include <RootCoreUtils/Assert.h>
#include <RootCoreUtils/ShellExec.h>
#include <RootCoreUtils/ThrowMsg.h>
#include <SampleHandler/MessageCheck.h>
#include <iostream>
......@@ -53,11 +54,14 @@ namespace SH
getNext ()
{
RCU_CHANGE_INVARIANT (this);
using namespace msgScanDir;
if (!m_isRead)
{
std::string command = "xrdfs " + m_server + " ls -l " + m_directory;
ANA_MSG_DEBUG ("trying XRD command: " << command);
m_list = RCU::Shell::exec_read (command);
ANA_MSG_DEBUG ("XRD command output:\n" << command);
m_context = "command: " + command + "\n" + m_list;
m_isRead = true;
}
......@@ -69,6 +73,7 @@ namespace SH
split1 = m_list.size();
const std::string line (m_list.substr (0, split1));
ANA_MSG_DEBUG ("next XRD list line: " << line);
m_list = m_list.substr (split1 + 1);
std::string::size_type split2 = line.find ('/');
......@@ -77,6 +82,8 @@ namespace SH
{
m_isDir = line[0] == 'd';
m_file = line.substr (split2);
ANA_MSG_DEBUG ("next XRD file found: " << m_file);
ANA_MSG_DEBUG ("XRD file isDir: " << m_isDir);
return true;
}
......@@ -84,13 +91,9 @@ namespace SH
{
std::string message = "failed to parse line: \"" + line + "\"\n" + m_context;
ANA_MSG_WARNING (message);
if (!m_laxParser)
{
RCU_THROW_MSG (message);
} else
{
RCU_WARN_MSG (message);
}
throw std::runtime_error (message);
}
}
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment