summaryrefslogtreecommitdiff
path: root/zuul/web/__init__.py
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2022-10-26 16:10:01 -0700
committerJames E. Blair <jim@acmegating.com>2022-11-10 15:52:46 -0800
commit1245d100ca8ca3f206c33ecb9817a65daa65729d (patch)
treeca05ec31efe3a420ef223bceb7eda90e9582c14d /zuul/web/__init__.py
parent57451d04b99b83b1568094253b8942e365927a29 (diff)
downloadzuul-1245d100ca8ca3f206c33ecb9817a65daa65729d.tar.gz
Refactor merge mode name lookup
This is repeated in a few places, centralize it. Change-Id: I7bbed1f5f9faad31affa71ef17fbfc1740c54db8
Diffstat (limited to 'zuul/web/__init__.py')
-rwxr-xr-xzuul/web/__init__.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py
index 487c115c1..de8e91c2c 100755
--- a/zuul/web/__init__.py
+++ b/zuul/web/__init__.py
@@ -1241,10 +1241,7 @@ class ZuulWebAPI(object):
result = project.toDict()
result['configs'] = []
md = tenant.layout.getProjectMetadata(project.canonical_name).toDict()
- for k, v in model.MERGER_MAP.items():
- if v == md['merge_mode']:
- md['merge_mode'] = k
- break
+ md['merge_mode'] = model.get_merge_mode_name(md['merge_mode'])
result['metadata'] = md
configs = tenant.layout.getAllProjectConfigs(project.canonical_name)
for config_obj in configs: