Page MenuHomec4science

loadconf.py
No OneTemporary

File Metadata

Created
Wed, Jun 12, 04:42

loadconf.py

# © All rights reserved. ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE,
# Switzerland
# SCITAS - Scientific IT and Application Support, 2021
# See the LICENSE.txt file for more details.
import json
class LoadConf(object):
def __init__(self):
self.clusters = []
self.currencies = ["time", "chf", "co2"]
self.time = {}
self.chf = {}
self.co2 = {}
with open('/etc/sausage/sausage-api.json') as fj:
self.conf = json.load(fj)
for key, value in self.conf.items():
self.clusters.append(key)
for cl in self.clusters:
self.time.update({cl: 1, })
self.chf.update({cl: self.conf[cl]["chf"], })
self.co2.update({cl: self.conf[cl]["co2"], })

Event Timeline