Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Fix user agent string (#398)
Browse files Browse the repository at this point in the history
* Fix user agent string

* Lint

* Upgraded package version with fix for user agent string

* Fix versioning for tests

* Do not reassign when object is directly mutated
  • Loading branch information
enriquejosepadilla authored May 28, 2019
1 parent 33dc66e commit ae772d9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions django_cloud_deploy/cloudlib/project.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Google LLC
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,7 @@
See https://gcloud-python.readthedocs.io/en/latest/resource-manager/api.html
"""

from django_cloud_deploy import __version__
from typing import Any, Dict, List

import backoff
Expand Down Expand Up @@ -50,10 +51,9 @@ def __init__(self, cloudresourcemanager_service: discovery.Resource):

@classmethod
def from_credentials(cls, credentials: credentials.Credentials):
http_client = http.set_user_agent(http.build_http(),
'django-cloud-deploy')
auth_http = google_auth_httplib2.AuthorizedHttp(credentials,
http=http_client)
auth_http = google_auth_httplib2.AuthorizedHttp(credentials)
user_agent = '/'.join(['django-cloud-deploy', __version__.__version__])
http.set_user_agent(auth_http, user_agent)
return cls(
discovery.build('cloudresourcemanager',
'v1',
Expand Down
2 changes: 1 addition & 1 deletion django_cloud_deploy/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'google-cloud-storage==1.10.0',
'pexpect==4.6.0',
'psycopg2-binary==2.7.5',
'google-api-python-client==1.7.4',
'google-api-python-client==1.7.9',
'google-auth-httplib2==0.0.3',
'selenium==3.141.0',
'google-cloud-logging==1.8.0',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
'kubernetes>=6.0.0',
'grpcio>=1.14.1',
'pexpect>=4.6.0',
'google-api-python-client>=1.7.4',
'google-api-python-client>=1.7.9',
'google-auth-httplib2>=0.0.3',
'progressbar2>=3.38.0',
'portpicker>=1.2.0',
Expand Down

0 comments on commit ae772d9

Please sign in to comment.