From 2f1cea99fadd11fe963950272fcb9017775e84bf Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 17 Mar 2019 01:34:42 +0100 Subject: [PATCH] Support for environment variables passed through main config --- platypush/config/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index b902bbef0..dbe6b936a 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -3,7 +3,6 @@ import logging import os import socket import sys -import time import yaml from platypush.utils import get_hash @@ -105,6 +104,10 @@ class Config(object): if 'device_id' not in self._config: self._config['device_id'] = socket.gethostname() + if 'environment' in self._config: + for k,v in self._config['environment']: + os.environ[k] = v + self.backends = {} self.plugins = {} self.event_hooks = {}