Skip to content

Commit abb4944

Browse files
author
Joao Afonso
committed
MGM: CTA - Removing newline from EOS report error message
1 parent e6aeac9 commit abb4944

1 file changed

Lines changed: 14 additions & 24 deletions

File tree

mgm/proc/admin/EvictCmd.cc

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@ eos::console::RequestProto eos::mgm::EvictCmd::convertStagerRmToEvict(
5959

6060
default:
6161
errStream <<
62-
"error: Received a file with neither a path nor an fid, unable to convert stagerrm request to evict request"
63-
<<
64-
std::endl;
62+
"error: Received a file with neither a path nor an fid, unable to convert stagerrm request to evict request";
6563
ret_c = EINVAL;
6664
EosCtaReporterEvict eosLog;
6765
eosLog
@@ -151,7 +149,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
151149
path = file.path();
152150

153151
if (0 == path.length()) {
154-
errStream << "error: Received an empty string path" << std::endl;
152+
errStream << "error: Received an empty string path";
155153
ret_c = EINVAL;
156154
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
157155
continue;
@@ -164,8 +162,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
164162
GetPathFromFid(path, file.fid(), err);
165163

166164
if (0 == path.length()) {
167-
errStream << "error: Received an unknown fid: value=" << file.fid() <<
168-
std::endl;
165+
errStream << "error: Received an unknown fid: value=" << file.fid();
169166
ret_c = EINVAL;
170167
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
171168
continue;
@@ -175,8 +172,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
175172
break;
176173

177174
default:
178-
errStream << "error: Received a file with neither a path nor an fid" <<
179-
std::endl;
175+
errStream << "error: Received a file with neither a path nor an fid";
180176
ret_c = EINVAL;
181177
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
182178
continue;
@@ -188,7 +184,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
188184

189185
if (gOFS->_access(cPath.GetParentPath(), P_OK, errInfo, mVid, "") != 0) {
190186
errStream << "error: you don't have 'p' acl flag permission on path '"
191-
<< cPath.GetParentPath() << "'" << std::endl;
187+
<< cPath.GetParentPath() << "'";
192188
ret_c = EPERM;
193189
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
194190
continue;
@@ -199,20 +195,19 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
199195
errInfo.clear();
200196

201197
if (gOFS->_exists(path.c_str(), file_exists, errInfo, mVid, nullptr)) {
202-
errStream << "error: unable to run exists on path '" << path << "'" <<
203-
std::endl;
198+
errStream << "error: unable to run exists on path '" << path << "'";
204199
ret_c = errno;
205200
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
206201
continue;
207202
}
208203

209204
if (file_exists == XrdSfsFileExistNo) {
210-
errStream << "error: no such file with path '" << path << "'" << std::endl;
205+
errStream << "error: no such file with path '" << path << "'";
211206
ret_c = ENODATA;
212207
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
213208
continue;
214209
} else if (file_exists == XrdSfsFileExistIsDirectory) {
215-
errStream << "error: given path is a directory '" << path << "'" << std::endl;
210+
errStream << "error: given path is a directory '" << path << "'";
216211
ret_c = EINVAL;
217212
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
218213
continue;
@@ -222,16 +217,15 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
222217

223218
if (gOFS->_stat(path.c_str(), &buf, errInfo, mVid, nullptr, nullptr,
224219
false) != 0) {
225-
errStream << "error: unable to run stat for replicas on path '" << path << "'"
226-
<< std::endl;
220+
errStream << "error: unable to run stat for replicas on path '" << path << "'";
227221
ret_c = EINVAL;
228222
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
229223
continue;
230224
}
231225

232226
// we don't remove anything if it's not on tape
233227
if ((buf.st_mode & EOS_TAPE_MODE_T) == 0) {
234-
errStream << "error: no tape replicas for file '" << path << "'" << std::endl;
228+
errStream << "error: no tape replicas for file '" << path << "'";
235229
ret_c = EINVAL;
236230
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
237231
continue;
@@ -260,8 +254,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
260254
if (!diskReplicaFound) {
261255
eos_static_err("msg=\"unable to find disk replica of %s\" fsid=\"%u\" reason=\"%s\"",
262256
path.c_str(), fsid.value(), errInfo.getErrText());
263-
errStream << "error: unable to find disk replica of '" << path << "'" <<
264-
std::endl;
257+
errStream << "error: unable to find disk replica of '" << path << "'";
265258
eosLog.addParam(EosCtaReportParam::EVICTCMD_FSID, fsid.value());
266259
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
267260
ret_c = SFS_ERROR;
@@ -282,8 +275,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
282275
if (diskReplicaCount == 0) {
283276
eos_static_err("msg=\"unable to find any disk replica of %s\" reason=\"%s\"",
284277
path.c_str(), errInfo.getErrText());
285-
errStream << "error: unable to find any disk replica of '" << path << "'" <<
286-
std::endl;
278+
errStream << "error: unable to find any disk replica of '" << path << "'";
287279
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
288280
ret_c = SFS_ERROR;
289281
continue;
@@ -300,8 +292,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
300292
ignoreRemovalOnFst) != 0) {
301293
eos_static_err("msg=\"could not delete replica of %s\" fsid=\"%u\" reason=\"%s\"",
302294
path.c_str(), fsid.value(), errInfo.getErrText());
303-
errStream << "error: could not delete replica of '" << path << "'" <<
304-
std::endl;
295+
errStream << "error: could not delete replica of '" << path << "'";
305296
eosLog.addParam(EosCtaReportParam::EVICTCMD_FSID, fsid.value());
306297
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
307298
ret_c = SFS_ERROR;
@@ -351,8 +342,7 @@ eos::mgm::EvictCmd::ProcessRequest() noexcept
351342
if (gOFS->_dropallstripes(path.c_str(), errInfo, root_vid) != 0) {
352343
eos_static_err("msg=\"could not delete all disk replicas of %s\" reason=\"%s\"",
353344
path.c_str(), errInfo.getErrText());
354-
errStream << "error: could not delete all disk replicas of '" << path << "'" <<
355-
std::endl;
345+
errStream << "error: could not delete all disk replicas of '" << path << "'";
356346
eosLog.addParam(EosCtaReportParam::EVICTCMD_ERROR, errStream.str());
357347
ret_c = SFS_ERROR;
358348
} else {

0 commit comments

Comments
 (0)