Commit 51c5dcb0 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor fix on data retrieve from 'dsmdf' command.

parent 965b0838
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -87,14 +87,13 @@ class TapeClient(object):
        else:
            exitCode = stdout.channel.recv_exit_status()
            if not exitCode:
                result = stdout.readlines()[0].rstrip('\n')
                self.HSMFilesystemList = result.splitlines()
                self.HSMFilesystemList = [ el.rstrip('\n') for el in stdout.readlines() ]
                return self.HSMFilesystemList.copy()
            else:
                raise TapeClientException(cmd, exitCode, stderr)

    def getHSMFilesystemFreeSpace(self, HSMFilesystem):
        "Returns the free space in bytes for a given HSM filesystem."
        """Returns the free space in bytes for a given HSM filesystem."""
        cmd = f"{self.DSMDF} -detail {HSMFilesystem} | grep \"Free Size\" | awk '{{ print $3 }}'"
        try:
            stdin, stdout, stderr = self.client.exec_command(cmd)