fix headers typo

This commit is contained in:
lrossett 2021-06-15 18:26:43 -03:00
parent 7d1d21c988
commit cb72cfd724
No known key found for this signature in database
GPG key ID: A073363F751EEE2B

View file

@ -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)))