cloudpassage/connector

View on GitHub
lib/loadyaml.py

Summary

Maintainability
A
0 mins
Test Coverage
"""This module contains methods that load different yml file"""
import os
import yaml


RSYSLOG_CONFIG = os.path.join(os.path.dirname(__file__), '../configs/rsyslog.yml')
PORTAL_CONFIG = os.path.join(os.path.dirname(__file__), '../configs/portal.yml')
CEF_CONFIG = os.path.join(os.path.dirname(__file__), '../configs/cef.yml')
LEEF_CONFIG = os.path.join(os.path.dirname(__file__), '../configs/leef.yml')


def load_rsyslog():
    """This method load the rsyslog.yml"""
    return yaml.safe_load(open(RSYSLOG_CONFIG, 'r'))


def load_portal():
    """This method load the portal.yml"""
    return yaml.safe_load(open(PORTAL_CONFIG, 'r'))


def load_cef():
    """This method load the cef.yml"""
    return yaml.safe_load(open(CEF_CONFIG, 'r'))


def load_leef():
    """This method load the leef.yml"""
    return yaml.safe_load(open(LEEF_CONFIG, 'r'))