Commit e5ef6bdf authored by Steven Murray's avatar Steven Murray
Browse files

Removed false/emulated nameserver check from LabelSession

It was planned to have the LabelSession of the new tapeserverd
daemon check that a tape being labeled was empty with respect to
the CASTOR namespace.  This feature, which currently does not
exist within either rtcpd or taped has turned out to be more
difficult to implement than expected.  This new additional feature
is therefore being dropped before it gets released.
parent d9731bf8
......@@ -44,7 +44,6 @@
//------------------------------------------------------------------------------
castor::tape::tapeserver::daemon::LabelSession::LabelSession(
legacymsg::RmcProxy &rmc,
legacymsg::NsProxy &ns,
const legacymsg::TapeLabelRqstMsgBody &clientRequest,
castor::log::Logger &log,
System::virtualWrapper &sysWrapper,
......@@ -52,7 +51,6 @@ castor::tape::tapeserver::daemon::LabelSession::LabelSession(
const bool force):
m_timeout(1), // 1 second of timeout for the network in the label session. This is not going to be a parameter of the constructor
m_rmc(rmc),
m_ns(ns),
m_request(clientRequest),
m_log(log),
m_sysWrapper(sysWrapper),
......@@ -93,7 +91,6 @@ void castor::tape::tapeserver::daemon::LabelSession::execute() {
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::LabelSession::performPreMountChecks() {
checkClientIsOwnerOrAdmin();
checkIfVidStillHasSegments();
}
//------------------------------------------------------------------------------
......@@ -104,34 +101,6 @@ void castor::tape::tapeserver::daemon::LabelSession::
// TO BE DONE
}
//------------------------------------------------------------------------------
// checkIfVidStillHasSegments
//------------------------------------------------------------------------------
void castor::tape::tapeserver::daemon::LabelSession::checkIfVidStillHasSegments() {
// check if the volume still contains active or inactive segments. If yes, no labeling allowed, even with the force flag enabled.
castor::legacymsg::NsProxy::TapeNsStatus rc = m_ns.doesTapeHaveNsFiles(m_request.vid);
if(rc==castor::legacymsg::NsProxy::NSPROXY_TAPE_HAS_AT_LEAST_ONE_DISABLED_SEGMENT) {
castor::exception::Exception ex;
ex.getMessage() << "End session with error. Tape has at least one disabled segment. Aborting labelling...";
throw ex;
}
else if (rc==castor::legacymsg::NsProxy::NSPROXY_TAPE_HAS_AT_LEAST_ONE_ACTIVE_SEGMENT) {
castor::exception::Exception ex;
ex.getMessage() << "End session with error. Tape has at least one active segment. Aborting labelling...";
throw ex;
}
else {} // rc==castor::legacymsg::NsProxy::NSPROXY_TAPE_EMPTY. Tape is empty, we are good to go..
const log::Param params[] = {
log::Param("vid", m_request.vid),
log::Param("unitName", m_request.drive),
log::Param("librarySlot", m_driveConfig.librarySlot)};
m_log(LOG_INFO,
"Tape to be labeled has no files registered in the name server", params);
}
//------------------------------------------------------------------------------
// getDriveObject
//------------------------------------------------------------------------------
......
......@@ -62,7 +62,6 @@ namespace daemon {
*/
LabelSession(
legacymsg::RmcProxy &rmc,
legacymsg::NsProxy &ns,
const legacymsg::TapeLabelRqstMsgBody &clientRequest,
castor::log::Logger &log,
System::virtualWrapper &sysWrapper,
......@@ -99,13 +98,6 @@ namespace daemon {
*/
void checkClientIsOwnerOrAdmin();
/**
* A meta-data check that sees if the tape to be labelled contains files
* that are registered in the CASTOR name-server as either active or
* disabled segments.
*/
void checkIfVidStillHasSegments();
/**
* Returns a Drive object representing the tape drive to be used to label
* a tape.
......@@ -148,11 +140,6 @@ namespace daemon {
*/
legacymsg::RmcProxy &m_rmc;
/**
* The object representing the rmcd daemon.
*/
legacymsg::NsProxy &m_ns;
/**
* The label request message body
*/
......
......@@ -843,7 +843,6 @@ int castor::tape::tapeserver::daemon::ProcessForker::runLabelSession(
castor::tape::System::realWrapper sWrapper;
LabelSession labelsession(
rmc,
ns,
labelJob,
m_log,
sWrapper,
......
Supports Markdown
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