diff options
author | Oliver Poignant <oliver@poignant.se> | 2016-05-18 21:14:21 +0200 |
---|---|---|
committer | Oliver Poignant <oliver@poignant.se> | 2016-05-18 21:14:21 +0200 |
commit | a7c118a8446da3edb32d2c06b11a3317ebe4a22d (patch) | |
tree | 3caa39b8a4114a85ce3282c24e44f806f2b20086 /gitautodeploy/cli/config.py | |
parent | f3549261d30ae22fc86977a2a8661f965d95684f (diff) | |
download | Git-Auto-Deploy-a7c118a8446da3edb32d2c06b11a3317ebe4a22d.zip Git-Auto-Deploy-a7c118a8446da3edb32d2c06b11a3317ebe4a22d.tar.gz Git-Auto-Deploy-a7c118a8446da3edb32d2c06b11a3317ebe4a22d.tar.bz2 |
Handle legacy filter config syntax
Diffstat (limited to 'gitautodeploy/cli/config.py')
-rw-r--r-- | gitautodeploy/cli/config.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gitautodeploy/cli/config.py b/gitautodeploy/cli/config.py index d482621..cd8c54c 100644 --- a/gitautodeploy/cli/config.py +++ b/gitautodeploy/cli/config.py @@ -277,6 +277,25 @@ 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'] = [] + + # Rewrite some legacy filter config syntax + for filter in repo_config['filters']: + + # Legacy config syntax? + if ('kind' in filter and filter['kind'] == 'pull-request-handler') or ('type' in filter and filter['type'] == 'pull-request-filter'): + + # Reset legacy values + filter['kind'] = None + filter['type'] = None + + if 'ref' in filter: + filter['pull_request.base.ref'] = filter['ref'] + filter['ref'] = None + + filter['pull_request'] = True + return config def get_repo_config_from_environment(): |