Skip to content

Commit

Permalink
Merge pull request #7 from pmandrik/api_fix
Browse files Browse the repository at this point in the history
Add certificate test to API
  • Loading branch information
jfernan2 authored Nov 15, 2021
2 parents 3da5fb3 + 9dc4905 commit 32930ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runregistry_api_client/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To use python 3.6 in lxplus: https://cern.service-now.com/service-portal?id=kb_a
A virtual environment is also required, if you are in lxplus you should run the following commands:

```bash
virtualenv venv
virtualenv -p `which python3` venv
source venv/bin/activate
```

Expand Down
6 changes: 3 additions & 3 deletions runregistry_api_client/runregistry/runregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import urllib3

# Silence unverified HTTPS warning:
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
PAGE_SIZE = 50

staging_cert = "certs/usercert.pem"
Expand Down Expand Up @@ -40,7 +40,7 @@ def _get_cookies(url, **kwargs):
)
ca_bundle = certs.where()
# Skip SSL verification since this must be fixed in the cernrequest package
cookies = get_sso_cookies(url, cert, verify=False)
cookies = get_sso_cookies(url, cert, verify=True)
return cookies


Expand Down Expand Up @@ -82,7 +82,7 @@ def get_dataset_names_of_run(run_number, **kwargs):
"""
url = "{}/get_all_dataset_names_of_run/{}".format(api_url, run_number)
cookies = _get_cookies(url, **kwargs)
return requests.get(url, cookies=cookies, verify=False).json()
return requests.get(url, cookies=cookies, verify=True).json()


def get_run(run_number, **kwargs):
Expand Down

0 comments on commit 32930ee

Please sign in to comment.