diff options
author | azul <azul@riseup.net> | 2014-04-18 14:34:32 +0200 |
---|---|---|
committer | azul <azul@riseup.net> | 2014-04-18 14:34:32 +0200 |
commit | 8078cf0f853310cfb0d0681db45effb96850efc9 (patch) | |
tree | 86fb496091a772cefd0e07d1558f6b7fe0636963 /test/nagios/support/config.py | |
parent | 3513ad74f950b113af1ba1e3d06bc6a55c48fde5 (diff) | |
parent | d639e0a48599b30777b80c2809ded1efb3a6d926 (diff) |
Merge pull request #147 from azul/test/nagios-test-signup0.5.1-rc
Test/nagios test signup
Diffstat (limited to 'test/nagios/support/config.py')
-rw-r--r-- | test/nagios/support/config.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/nagios/support/config.py b/test/nagios/support/config.py new file mode 100644 index 0000000..afb4464 --- /dev/null +++ b/test/nagios/support/config.py @@ -0,0 +1,14 @@ +import yaml + +class Config(): + def __init__(self, filename="/etc/leap/hiera.yaml"): + with open("/etc/leap/hiera.yaml", 'r') as stream: + config = yaml.load(stream) + self.user = config['webapp']['nagios_test_user'] + if 'username' not in self.user: + raise Exception('nagios test user lacks username') + if 'password' not in self.user: + raise Exception('nagios test user lacks password') + self.api = config['api'] + self.api['version'] = config['webapp']['api_version'] + |