From 4907f9c4061a7480d6d263e1597b6f76cb5d54c4 Mon Sep 17 00:00:00 2001 From: samwiseg0 Date: Wed, 5 Dec 2018 13:59:22 -0500 Subject: [PATCH] Update README and log messgaes --- README.md | 3 ++- varken/iniparser.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7ba149e..5ddecfe 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,13 @@ Requirements /w install links: [Grafana](http://docs.grafana.org/installation/), ## Quick Setup (Varken Alpha) 1. Clone the repository `sudo git clone https://github.com/Boerderij/Varken.git /opt/Varken` 1. Follow the systemd install instructions located in `varken.systemd` -1. Create venv in project `/usr/bin/python3 -m venv varken-venv` +1. Create venv in project `cd /opt/Varken && /usr/bin/python3 -m venv varken-venv` 1. Install requirements `/opt/Varken/varken-venv/bin/python -m pip install -r requirements.txt` 1. Make a copy of `varken.example.ini` to `varken.ini` in the `data` folder `cp /opt/Varken/data/varken.example.ini /opt/Varken/data/varken.ini` 1. Make the appropriate changes to `varken.ini` ie.`nano /opt/Varken/data/varken.ini` +1. Make sure all the files have the appropriate permissions `sudo chown varken:varken -R /opt/Varken` 1. After completing the [getting started](http://docs.grafana.org/guides/getting_started/) portion of grafana, create your datasource for influxdb. 1. Install `grafana-cli plugins install grafana-worldmap-panel` 1. TODO:: Click the + on your menu and click import. Using the .json provided in this repo, paste it in and customize as you like. diff --git a/varken/iniparser.py b/varken/iniparser.py index 4a2c962..7c12d2f 100644 --- a/varken/iniparser.py +++ b/varken/iniparser.py @@ -36,7 +36,7 @@ class INIParser(object): t = server_type global_server_ids = self.config.get('global', t) if global_server_ids.lower() in ['false', 'no', '0']: - logger.info('{} disabled.'.format(t.upper())) + logger.info('%s disabled.', t.upper()) return False else: sids = self.clean_check(global_server_ids, t) @@ -54,10 +54,10 @@ class INIParser(object): logger.error("{} is not a valid server id number".format(sid)) if valid_sids: - logger.info('{} : {}'.format(t.upper(), valid_sids)) + logger.info('%s : %s', t.upper(), valid_sids) return valid_sids else: - logger.error("No valid {}".format(t.upper())) + logger.error('No valid %s', t.upper()) return False def read_file(self): @@ -66,7 +66,7 @@ class INIParser(object): with open(file_path) as config_ini: self.config.read_file(config_ini) else: - exit("You do not have a varken.ini file in {}".format(self.data_folder)) + exit('Config file missing (varken.ini) in {}'.format(self.data_folder)) def parse_opts(self): self.read_file()