Beispiel #1
0
import os
import errno
import time
import threading
import subprocess
import warnings
from resalloc import helpers
from resalloc.helpers import RState
from resallocserver import models
from resallocserver.db import session_scope
from resallocserver.log import get_logger
from resallocserver.logic import QResources, QTickets
from resallocserver.config import CONFIG_DIR, CONFIG

log = get_logger(__name__)


def run_command(pool_id,
                res_id,
                res_name,
                id_in_pool,
                command,
                ltype='alloc',
                catch_stdout_bytes=None):
    log.debug("running: " + command)
    pfx = 'RESALLOC_'
    env = os.environ.copy()
    env[pfx + 'ID'] = str(res_id)
    env[pfx + 'NAME'] = str(res_name)
    env[pfx + 'POOL_ID'] = str(pool_id)
Beispiel #2
0
 def instantiate_log():
     return get_logger("resallocserver")