#50 fix headers typo
Merged 3 months ago by mohanboddu. Opened 3 months ago by lrossett.
centos/ lrossett/centpkg do_fork-fix  into  develop

file modified
+2 -2

@@ -67,7 +67,7 @@ 

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

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

fixes #49

Using headers instead of header in http requests.

Pull-Request has been merged by mohanboddu

3 months ago
Metadata