Exemplo n.º 1
0
 def __init__(self, config, queue):
     # get config settings
     self.provider_starttime = None
     self.container_queue = queue  # Initially empty
     self.paths = config['paths']
     self.docker_conf = config['docker']
     self.fetcher_conf = config['fetcher']
     self.builder_conf = config['builder']
     self.logger = log.get_module_log(__name__)
Exemplo n.º 2
0
#!/usr/bin/env python
# encoding: utf-8

"""
container_config.py
Provides a configuration wrapper for container objects.
"""

import os
import zipfile

from dopq_server.model.utils import log
from dopq_server.model.container_handler.container_config import ContainerConfig

LOG = log.get_module_log(__name__)


## This particular method will be used if user put unzipped
## file into the network folder. Currently not in use.


def parse_unzipped_config(folder_path, config_filename="container_config.json"):
    """
    Reads a container configuration from a given (unzipped) folder path.
    :param folder_path: Path to folder, which contains all container files.
    :param config_filename: File name for configuration file.
    :return: ContainerConfig instance if successful, otherwise None
    """

    # build path
    file_path = os.path.join(folder_path, config_filename)