コード例 #1
0
ファイル: tasks.py プロジェクト: victorkeophila/cosmo-manager
def reload_riemann_config(policies,
                          rules,
                          policies_events,
                          riemann_config_template,
                          riemann_config_path,
                          riemann_pid, 
                          **kwargs):

    logger.debug("reloading riemann configuration")

    new_riemann_config = build_riemann_config(riemann_config_template, policies, rules, policies_events)

    with open(riemann_config_path, 'w') as config:
        config.write(new_riemann_config)
    # causes riemann server to reload the configuration
    os.kill(int(riemann_pid), signal.SIGHUP)
コード例 #2
0
 def test_build_riemann_config(self):
     print build_riemann_config(self.template, self.policies, self.rules, self.policies_events)