Commit 85694b4f authored by Volodymyr Yurchenko's avatar Volodymyr Yurchenko
Browse files

Check if there is default mount rule

This commit adds a check for a requester mount policy with the hardcoded
name "default". Requester mount rule with this name must be present on
eoscta instance to pass this check
parent 817da140
......@@ -40,6 +40,8 @@
#include <ctype.h>
#include <memory>
#include <time.h>
#include <sys/types.h>
#include <grp.h>
namespace cta {
namespace catalogue {
......@@ -7311,11 +7313,16 @@ uint64_t RdbmsCatalogue::checkAndGetNextArchiveFileId(const std::string &diskIns
const auto groupMountPolicy = getCachedRequesterGroupMountPolicy(Group(diskInstanceName, user.group));
if(!groupMountPolicy) {
exception::UserError ue;
ue.getMessage() << "No mount rules for the requester or their group:"
" storageClass=" << storageClassName << " requester=" << diskInstanceName << ":" << user.name << ":" <<
user.group;
throw ue;
const auto defaultMountPolicy = getCachedRequesterMountPolicy(User(diskInstanceName, "default"));
if(!defaultMountPolicy) {
exception::UserError ue;
ue.getMessage() << "No mount rules for the requester or their group:"
" storageClass=" << storageClassName << " requester=" << diskInstanceName << ":" << user.name << ":" <<
user.group;
throw ue;
}
}
}
......@@ -7364,10 +7371,14 @@ common::dataStructures::ArchiveFileQueueCriteria RdbmsCatalogue::getArchiveFileQ
mountPolicy = getCachedRequesterGroupMountPolicy(Group(diskInstanceName, user.group));
if(!mountPolicy) {
exception::UserError ue;
ue.getMessage() << "No mount rules for the requester or their group: storageClass=" << storageClassName <<
" requester=" << diskInstanceName << ":" << user.name << ":" << user.group;
throw ue;
mountPolicy = getCachedRequesterMountPolicy(User(diskInstanceName, "default"));
if(!mountPolicy) {
exception::UserError ue;
ue.getMessage() << "No mount rules for the requester or their group: storageClass=" << storageClassName <<
" requester=" << diskInstanceName << ":" << user.name << ":" << user.group;
throw ue;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment