From 0256b384f914fd9cc8251b77535e3330349ffd2f Mon Sep 17 00:00:00 2001
From: Eric Wayne Vaandering <ewv@fnal.gov>
Date: Wed, 20 Apr 2022 17:31:57 +0200
Subject: [PATCH] Resolve "Allow VOL1 tape label to read Enstore tape labels"

---
 ReleaseNotes.md                                       | 1 +
 tapeserver/castor/tape/tapeserver/file/Structures.cpp | 4 ++--
 tapeserver/castor/tape/tapeserver/file/Structures.hpp | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/ReleaseNotes.md b/ReleaseNotes.md
index e54751a852..3cc4bc0c19 100644
--- a/ReleaseNotes.md
+++ b/ReleaseNotes.md
@@ -20,6 +20,7 @@ Please consult the [database upgrade documentation](https://eoscta.docs.cern.ch/
 - cta/CTA#1155 - Remove GCC suppresions in DriveGeneric and file/Structures
 - cta/CTA#1173 - Remove GCC '-Wno-unused-function' suppresion
 - cta/CTA#1166 - Add SCL-RH Repo to CTA CI boot scripts
+- cta/CTA#1185 - Make expectedLabelStandard default argument (for Enstore reads)
 
 ### Catalogue Schema
 - cta/CTA#1043 - Add verification column to tape table
diff --git a/tapeserver/castor/tape/tapeserver/file/Structures.cpp b/tapeserver/castor/tape/tapeserver/file/Structures.cpp
index edfccf3fe0..9bb835c24e 100644
--- a/tapeserver/castor/tape/tapeserver/file/Structures.cpp
+++ b/tapeserver/castor/tape/tapeserver/file/Structures.cpp
@@ -36,14 +36,14 @@ void tapeFile::VOL1::fill(std::string VSN,
   setString(m_LBPMethod, hexLBP.str());
 }
 
-void tapeFile::VOL1::verify() {
+void tapeFile::VOL1::verify(const char *const expectedLblStandard) {
   if (cmpString(m_label, "VOL1"))
     throw cta::exception::Exception(std::string("Failed verify for the VOL1: ") +
           tapeFile::toString(m_label));
   if (!cmpString(m_VSN, ""))
     throw cta::exception::Exception(std::string("Failed verify for the VSN: ") +
           tapeFile::toString(m_VSN));
-  const char *const expectedLblStandard = "3";
+
   if (cmpString(m_lblStandard, expectedLblStandard))
     throw cta::exception::Exception(
           std::string("Failed verify for the label standard: expected=") +
diff --git a/tapeserver/castor/tape/tapeserver/file/Structures.hpp b/tapeserver/castor/tape/tapeserver/file/Structures.hpp
index 2d1ed2a26b..e33db3f6e4 100644
--- a/tapeserver/castor/tape/tapeserver/file/Structures.hpp
+++ b/tapeserver/castor/tape/tapeserver/file/Structures.hpp
@@ -121,7 +121,7 @@ namespace tape {
       /**
        * Throws an exception if the structure does not match expectations.
        */
-      void verify();
+      void verify(const char *const expectedLblStandard = "3");
     };
 
     class VOL1withCrc : public VOL1 {
-- 
GitLab