From cb72cfd72440736d3451c2a13e04ff770afcb663 Mon Sep 17 00:00:00 2001
From: lrossett <lrossett@redhat.com>
Date: Tue, 15 Jun 2021 18:26:43 -0300
Subject: [PATCH] fix headers typo
---
src/centpkg/utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/centpkg/utils.py b/src/centpkg/utils.py
index 6d27b0e..8bc3b4c 100644
--- a/src/centpkg/utils.py
+++ b/src/centpkg/utils.py
@@ -67,7 +67,7 @@ def do_fork(logger, base_url, token, repo_name, namespace, cli_name):
fork_id = rv.json()['id']
try:
# Unprotect c9s in fork
- rv = requests.delete('{0}/projects/{1}/protected_branches/{2}'.format(api_url, fork_id, 'c9s'), headers=header)
+ rv = requests.delete('{0}/projects/{1}/protected_branches/{2}'.format(api_url, fork_id, 'c9s'), headers=headers)
except ConnectionError as error:
error_msg = ('The connection to API failed while trying to unprotect c9s branch'
'in the fork. The error was: {0}'.format(str(error)))
@@ -83,7 +83,7 @@ def do_fork(logger, base_url, token, repo_name, namespace, cli_name):
'allowed_to_push': [{'access_level': 40}],
'allowed_to_merge': [{'access_level': 40}],
}
- rv = requests.post('{0}/projects/{1}/protected_branches'.format(api_url, fork_id), json=data, headers=header)
+ rv = requests.post('{0}/projects/{1}/protected_branches'.format(api_url, fork_id), json=data, headers=headers)
except ConnectionError as error:
error_msg = ('The connection to API failed while trying to reprotect c9s branch'
'in the fork fork. The error was: {0}'.format(str(error)))
--
2.31.1