From 0f0057e65c6bfcb98ce53e1a48aa1460d3a6716a Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 16 Apr 2014 11:14:55 +0200 Subject: move support classes into their own package now the webapp_login test looks nice and clean. soledad next. --- test/nagios/support/config.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/nagios/support/config.py (limited to 'test/nagios/support/config.py') 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'] + -- cgit v1.2.3