How to use the cobbler.clogger function in cobbler

To help you get started, we’ve selected a few cobbler examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cobbler / cobbler / cobbler / actions / check.py View on Github external
def __init__(self, collection_mgr, logger=None):
        """
        Constructor
        """
        self.collection_mgr = collection_mgr
        self.settings = collection_mgr.settings()
        if logger is None:
            logger = clogger.Logger()
        self.logger = logger
github cobbler / cobbler / cobbler / actions / acl.py View on Github external
def __init__(self, collection_mgr, logger=None):
        """
        Constructor
        """
        self.collection_mgr = collection_mgr
        self.api = collection_mgr.api
        self.settings = collection_mgr.settings()
        if logger is None:
            logger = clogger.Logger()
        self.logger = logger
github cobbler / cobbler / cobbler / power_manager.py View on Github external
def __init__(self, api, collection_mgr, logger=None):
        """
        Constructor

        @param CobblerAPI api Cobbler API
        @param CollectionManager collection_mgr collection manager
        @param Logger logger logger
        """

        self.collection_mgr = collection_mgr
        self.settings = collection_mgr.settings()
        self.api = api
        if logger is None:
            logger = clogger.Logger()
        self.logger = logger
github cobbler / cobbler / cobbler / modules / managers / manage_tftpd_py.py View on Github external
def __init__(self, collection_mgr, logger):
        """
        Constructor
        """
        self.logger = logger
        if self.logger is None:
            self.logger = clogger.Logger()

        self.collection_mgr = collection_mgr
        self.templar = templar.Templar(collection_mgr)
github uyuni-project / uyuni / tftpsync / susemanager-tftpsync / sync_post_tftpd_proxies.py View on Github external
def run(api,args,logger):
    if not logger:
        logger = clogger.Logger()
    logger.info("sync_post_tftp_proxies started")
    settings = api.settings()

    # test if proxies are configured:
    try:
        p = settings.proxies
    except:
        # not configured - so we return
        return 0

    tftpbootdir = "/srv/tftpboot"
    syncstart = os.stat(tftpbootdir).st_mtime

    find_delete_from_proxies(tftpbootdir, settings, logger=logger)

    for root, dirs, files in os.walk(tftpbootdir):
github cobbler / cobbler / cobbler / modules / managers / manage_ndjbdns.py View on Github external
def __init__(self, config, logger):
        self.logger = logger
        if self.logger is None:
            self.logger = clogger.Logger()

        self.config = config
        self.systems = config.systems()
        self.templar = templar.Templar(config)
github cobbler / cobbler / cobbler / actions / action_log.py View on Github external
def __init__(self, collection_mgr, system, api, logger=None):
        """
        Log library constructor requires a cobbler system object.
        """
        self.system = system
        self.collection_mgr = collection_mgr
        self.settings = collection_mgr.settings()
        self.api = api
        if logger is None:
            logger = clogger.Logger()
        self.logger = logger
github cobbler / cobbler / cobbler / actions / action_dlcontent.py View on Github external
def __init__(self, collection_mgr, logger=None):
        """
        Constructor
        """
        self.collection_mgr = collection_mgr
        self.settings = collection_mgr.settings()
        if logger is None:
            logger = clogger.Logger()
        self.logger = logger
github cobbler / cobbler / cobbler / configgen.py View on Github external
def __init__(self, hostname):
        """Constructor. Requires a Cobbler API handle."""
        self.hostname = hostname
        self.handle = capi.CobblerAPI()
        self.system = self.handle.find_system(hostname=self.hostname)
        self.host_vars = self.get_cobbler_resource('autoinstall_meta')
        self.logger = clogger.Logger()
        self.mgmtclasses = self.get_cobbler_resource('mgmt_classes')
github cobbler / cobbler / cobbler / actions / action_report.py View on Github external
def __init__(self, collection_mgr, logger=None):
        """
        Constructor
        """
        self.collection_mgr = collection_mgr
        self.settings = collection_mgr.settings()
        self.api = collection_mgr.api
        self.report_type = None
        self.report_what = None
        self.report_name = None
        self.report_fields = None
        self.report_noheaders = None
        self.array_re = re.compile(r'([^[]+)\[([^]]+)\]')
        if logger is None:
            logger = clogger.Logger()
        self.logger = logger