Commit 67dc9a6e authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Minor changes.

parent 1b76e768
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ from tape_task import TapeTask

class TapeClient(object):

    # Constructor
    def __init__(self, host, port, user, password):
        self.host = host
        self.port = port
@@ -16,12 +17,14 @@ class TapeClient(object):
        self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        self.taskList = []
    
    # Connects to the tape library frontend
    def connect(self):
        self.client.connect(self.host,
                            self.port, 
                            self.user, 
                            self.password)
    
    # Returns the whole task list
    def getTaskList(self):
        stdin, stdout, stderr = self.client.exec_command("eeadm task list --json")
        exitCode = stdout.channel.recv_exit_status()
@@ -51,6 +54,7 @@ class TapeClient(object):
        else:
            sys.exit("cmd_exit_code = FAILURE")
    
    # Closes the connection
    def disconnect(self):
        self.client.close()

+21 −0
Original line number Diff line number Diff line
@@ -16,6 +16,27 @@ class TapeTask(object):
        self.taskId = None
        self.id = None
    
    """
    Getters
    """
    
    def getResult(self):
        return self.result
      
    def getStatus(self):
        return self.status    
      
    def success(self):
        return self.result == "succeeded"
      
    def completed(self):
        return self.status == "completed"
    
    
    """
    Setters
    """
    
    def setInUseTapes(self, inUseTapes):
        self.inUseTapes = inUseTapes