diff options
author | Oliver Poignant <oliver@poignant.se> | 2016-12-09 19:56:11 +0100 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2016-12-09 19:56:11 +0100 |
commit | 1c33c18730af7eb7fdc7bc88eb3c1730c34077c9 (patch) | |
tree | d01edb9a28320e53cdc0de1d77821c19ae2b853a /gitautodeploy/cli/config.py | |
parent | eda3e82575e90f9102df2b7a6871e6b48dad889a (diff) | |
download | Git-Auto-Deploy-1c33c18730af7eb7fdc7bc88eb3c1730c34077c9.zip Git-Auto-Deploy-1c33c18730af7eb7fdc7bc88eb3c1730c34077c9.tar.gz Git-Auto-Deploy-1c33c18730af7eb7fdc7bc88eb3c1730c34077c9.tar.bz2 |
Support for header filters
Diffstat (limited to 'gitautodeploy/cli/config.py')
-rw-r--r-- | gitautodeploy/cli/config.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gitautodeploy/cli/config.py b/gitautodeploy/cli/config.py index e5e68eb..17ab683 100644 --- a/gitautodeploy/cli/config.py +++ b/gitautodeploy/cli/config.py @@ -282,11 +282,19 @@ def init_config(config): if 'path' in repo_config: repo_config['path'] = os.path.expanduser(repo_config['path']) - if 'filters' not in repo_config: - repo_config['filters'] = [] + # Support for legacy config format + if 'filters' in repo_config: + repo_config['payload-filter'] = repo_config['filters'] + del repo_config['filters'] + + if 'payload-filter' not in repo_config: + repo_config['payload-filter'] = [] + + if 'header-filter' not in repo_config: + repo_config['header-filter'] = {} # Rewrite some legacy filter config syntax - for filter in repo_config['filters']: + for filter in repo_config['payload-filter']: # Legacy config syntax? if ('kind' in filter and filter['kind'] == 'pull-request-handler') or ('type' in filter and filter['type'] == 'pull-request-filter'): |