Skip to content

Commit

Permalink
Alpha11 (#155)
Browse files Browse the repository at this point in the history
* Check for credentials in instance instead of self.access_token_, fixes #153

* Refrain from passing credentials kwarg to get_job_results() in iter_job_results(), fixes #154

* Bump version
  • Loading branch information
sserrata committed Apr 13, 2020
1 parent 7877345 commit 4125e8f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# History

## 2.0.0-alpha11 (2020-04-13)

- Refrain from passing credentials kwarg to get_job_results() in iter_job_results(), fixes #154
- Check for credentials in instance instead of self.access*token*, fixes #153

## 2.0.0-alpha10 (2020-04-09)

- Refactored how and where credentials are applied to request headers (#151)
Expand Down
2 changes: 1 addition & 1 deletion pan_cortex_data_lake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""Main package for cortex."""

__author__ = "Palo Alto Networks"
__version__ = "2.0.0-a10"
__version__ = "2.0.0-a11"

from .exceptions import ( # noqa: F401
CortexError,
Expand Down
5 changes: 4 additions & 1 deletion pan_cortex_data_lake/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ def refresh(self, access_token=None, **kwargs):
with self.token_lock:
if access_token == self.access_token or access_token is None:
if self.developer_token is not None and not any(
[self.access_token_, os.getenv("PAN_ACCESS_TOKEN")]
[
os.getenv("PAN_ACCESS_TOKEN"),
self._credentials_found_in_instance,
]
):
parsed_provider = urlparse(self.developer_token_provider)
url = "{}://{}".format(
Expand Down
7 changes: 1 addition & 6 deletions pan_cortex_data_lake/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def iter_job_results(
requests.Response: Requests Response() object.
"""
credentials = kwargs.pop("credentials", None)
params = kwargs.pop("params", {})
enforce_json = kwargs.pop("enforce_json", True)
for name, value in [
Expand All @@ -234,11 +233,7 @@ def iter_job_results(
params.update({name: value})
while True:
r = self.get_job_results(
job_id=job_id,
params=params,
enforce_json=enforce_json,
credentials=credentials,
**kwargs
job_id=job_id, params=params, enforce_json=enforce_json, **kwargs
)
if not r.ok:
raise HTTPError("%s" % r.text)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.0.0a10
current_version = 2.0.0a11
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

setup(
name="pan-cortex-data-lake",
version="2.0.0-a10",
version="2.0.0-a11",
description="Python idiomatic SDK for Cortex™ Data Lake.",
long_description=readme + "\n\n" + history,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 4125e8f

Please sign in to comment.