Skip to content
Snippets Groups Projects
Commit 336cf94e authored by Cristiano Urban's avatar Cristiano Urban
Browse files

IBM Spectrum Protect integration: changed the way how we calculate the free...

IBM Spectrum Protect integration: changed the way how we calculate the free space in tape + minor changes.

Signed-off-by: default avatarCristiano Urban <cristiano.urban@inaf.it>
parent e9c66aed
No related branches found
No related tags found
No related merge requests found
......@@ -104,18 +104,15 @@ class StoreExecutor(TaskExecutor):
storageFreeSpace = free - self.TOL
self.logger.debug(f"storageFreeSpace (hot): {storageFreeSpace} B")
else:
self.tapeClient.connect()
tapePoolList = self.tapeClient.getPoolList()
self.tapeClient.disconnect()
try:
self.tapePool = self.dbConn.getTapePool(self.storageId)
self.tapeHSMFilesystem = self.dbConn.getTapeHSMFilesystem(self.storageId)
except Exception:
self.logger.exception("FATAL: unable to obtain the tape pool.")
self.logger.exception("FATAL: unable to obtain the tape HSM filesystem.")
return False
else:
for el in tapePoolList:
if el.getName() == self.tapePool:
storageFreeSpace = el.getFreeSpace() - self.TOL
self.tapeClient.connect()
storageFreeSpace = self.tapeClient.getHSMFilesystemFreeSpace(self.tapeHSMFilesystem) - self.TOL
self.tapeClient.disconnect()
self.logger.debug(f"storageFreeSpace (cold): {storageFreeSpace} B")
if storageFreeSpace < self.dataSize:
self.logger.error("FATAL: space available on the storage point is not enough.")
......
......@@ -93,7 +93,7 @@ class TapeClient(object):
else:
raise TapeClientException(cmd, exitCode, stderr)
def getHSMFileSystemFreeSpace(self, HSMFilesystem):
def getHSMFilesystemFreeSpace(self, HSMFilesystem):
"Returns the free space in bytes for a given HSM filesystem."
cmd = f"{self.DSMDF} -detail {HSMFilesystem} | grep "Free Size" | awk '{ print $3 }'"
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment