From d9e5f5edd13cc72bb96e24eeeaa92f86c2647989 Mon Sep 17 00:00:00 2001 From: Ronny Abraham Date: Tue, 16 Oct 2018 03:03:20 +0300 Subject: [PATCH] added code to check if the allowed_hosts param was set in the configuration file, if it was, then add the extra hosts to allowed hosts --- modules/initialize.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/initialize.py b/modules/initialize.py index edfe21f..26aecda 100644 --- a/modules/initialize.py +++ b/modules/initialize.py @@ -197,6 +197,15 @@ def get_config(branchname): dataobject.project.user = config['project']['user'] dataobject.project.group = config['project']['group'] + dataobject.project.allowedhosts = list() + _allowed = getattr(dataobject.project, 'allowedhosts') + _allowed.append(dataobject.project.extendedname) + _allowed.append(dataobject.project.host) + + if 'allowed_hosts' in config['project']: + for allowed in config['project']['allowed_hosts']: + _allowed.append(allowed) + dataobject.project.sudo = config['project']['sudo'] #