Commit b891b498 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Renamed 'OSUtils' in 'SystemUtils'.

parent 21760c9c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ import json

from amqp_server import AMQPServer
from db_connector import DbConnector
from os_utils import OSUtils
from system_utils import SystemUtils
from job import Job
from job_queue import JobQueue
from config import Config
@@ -33,7 +33,7 @@ class StoreAMQPServer(AMQPServer):
        self.params = config.loadSection("transfer_node")
        self.storageStorePath = self.params["store_path"]
        self.pendingQueueWrite = JobQueue("write_pending")
        self.osUtils = OSUtils()
        self.systemUtils = SystemUtils()
        self.job = None
        self.username = None
        self.path = None
@@ -51,7 +51,7 @@ class StoreAMQPServer(AMQPServer):
            self.job.setPhase("PENDING")
            #folderPath = "/home/" + user + "/store"
            folderPath = self.storageStorePath.replace("{username}", user)
            userInfo = self.osUtils.userInfo(user)
            userInfo = self.systemUtils.userInfo(user)
            # Check if the user exists on the transfer node
            if not userInfo:
                response = { "responseType": "ERROR",
+8 −3
Original line number Diff line number Diff line
import os

class OSUtils(object):

class SystemUtils(object):

    def __init__(self):
        pass
@@ -20,7 +21,11 @@ class OSUtils(object):
        fp.close()
        return False

    def setDefaultPerms(self, username):
        info = self.userInfo(username)


# Test
ou = OSUtils()
info = ou.userInfo("cristiano")
sysUtils = SystemUtils()
info = sysUtils.userInfo("cristiano")
print(info)