Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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
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
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)
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):
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)
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
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
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')
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