Skip to content

Commit

Permalink
update job status and update swagger-codegen-cli-3.0.52.jar
Browse files Browse the repository at this point in the history
  • Loading branch information
snuffkin committed Feb 9, 2024
1 parent 6bd8242 commit 1d5a793
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
9 changes: 6 additions & 3 deletions quri_parts/riqu/rest/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,12 @@ def get_basic_auth_token(self):
:return: The token for basic HTTP authentication.
"""
return urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
token = ""
if self.username or self.password:
token = urllib3.util.make_headers(
basic_auth=self.username + ':' + self.password
).get('authorization')
return token

def auth_settings(self):
"""Gets Auth Settings dict for api client.
Expand Down
13 changes: 6 additions & 7 deletions quri_parts/riqu/rest/models/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,12 @@ def status(self, status):
:param status: The status of this Job. # noqa: E501
:type: str
"""
# TODO temporarily commented out response status check
#allowed_values = ["created", "transpiling", "queued", "processing", "success", "failure", "cancelled"] # noqa: E501
#if status not in allowed_values:
# raise ValueError(
# "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
# .format(status, allowed_values)
# )
allowed_values = ["created", "queued", "preprocessing", "processing", "success", "failure", "cancelled"] # noqa: E501
if status not in allowed_values:
raise ValueError(
"Invalid value for `status` ({0}), must be one of {1}" # noqa: E501
.format(status, allowed_values)
)

self._status = status

Expand Down
4 changes: 2 additions & 2 deletions quri_parts/riqu/rest/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def __init__(self, resp):

def getheaders(self):
"""Returns a dictionary of the response headers."""
return self.urllib3_response.getheaders()
return self.urllib3_response.headers

def getheader(self, name, default=None):
"""Returns a given response header."""
return self.urllib3_response.getheader(name, default)
return self.urllib3_response.headers.get(name, default)


class RESTClientObject(object):
Expand Down

0 comments on commit 1d5a793

Please sign in to comment.