Skip to content

bump dependency of msrest: "msrest>=0.6.0,<0.7.0" #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vsts/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# http://pypi.python.org/pypi/setuptools

REQUIRES = [
"msrest>=0.5.0,<0.6.0"
"msrest>=0.6.0,<0.7.0"
]

CLASSIFIERS = [
Expand Down
11 changes: 4 additions & 7 deletions vsts/vsts/git/v4_0/git_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# --------------------------------------------------------------------------


from msrest.pipeline import ClientRequest
from msrest.universal_http import ClientRequest
from .git_client_base import GitClientBase


Expand All @@ -21,9 +21,8 @@ def __init__(self, base_url=None, creds=None):
super(GitClient, self).__init__(base_url, creds)

def get_vsts_info(self, relative_remote_url):
request = ClientRequest()
request.url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info')
request.method = 'GET'
url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info')
request = ClientRequest(method='GET', url=url)
headers = {'Accept': 'application/json'}
if self._suppress_fedauth_redirect:
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
Expand All @@ -34,9 +33,7 @@ def get_vsts_info(self, relative_remote_url):

@staticmethod
def get_vsts_info_by_remote_url(remote_url, credentials, suppress_fedauth_redirect=True):
request = ClientRequest()
request.url = remote_url.rstrip('/') + '/vsts/info'
request.method = 'GET'
request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info')
headers = {'Accept': 'application/json'}
if suppress_fedauth_redirect:
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
Expand Down
21 changes: 17 additions & 4 deletions vsts/vsts/git/v4_1/git_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# --------------------------------------------------------------------------


from msrest.pipeline import ClientRequest
from msrest.universal_http import ClientRequest
from .git_client_base import GitClientBase


Expand All @@ -20,13 +20,26 @@ def __init__(self, base_url=None, creds=None):
super(GitClient, self).__init__(base_url, creds)

def get_vsts_info(self, relative_remote_url):
request = ClientRequest()
request.url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info')
request.method = 'GET'
url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info')
request = ClientRequest(method='GET', url=url)
headers = {'Accept': 'application/json'}
if self._suppress_fedauth_redirect:
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
if self._force_msa_pass_through:
headers['X-VSS-ForceMsaPassThrough'] = 'true'
response = self._send_request(request, headers)
return self._deserialize('VstsInfo', response)

@staticmethod
def get_vsts_info_by_remote_url(remote_url, credentials,
suppress_fedauth_redirect=True,
force_msa_pass_through=True):
request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info')
headers = {'Accept': 'application/json'}
if suppress_fedauth_redirect:
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
if force_msa_pass_through:
headers['X-VSS-ForceMsaPassThrough'] = 'true'
git_client = GitClient(base_url=remote_url, creds=credentials)
response = git_client._send_request(request, headers)
return git_client._deserialize('VstsInfo', response)
10 changes: 3 additions & 7 deletions vsts/vsts/vss_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from msrest import Deserializer, Serializer
from msrest.exceptions import DeserializationError, SerializationError
from msrest.pipeline import ClientRequest
from msrest.universal_http import ClientRequest
from msrest.service_client import ServiceClient
from .exceptions import VstsAuthenticationError, VstsClientRequestError, VstsServiceError
from .vss_client_configuration import VssClientConfiguration
Expand Down Expand Up @@ -120,11 +120,9 @@ def _create_request_message(self, http_method, location_id, route_values=None,
route_values)
logger.debug('Route template: %s', location.route_template)
url = self._client.format_url(route_template, **route_values)
request = ClientRequest()
request.url = self._client.format_url(url)
request = ClientRequest(method=http_method, url=self._client.format_url(url))
if query_parameters:
request.format_parameters(query_parameters)
request.method = http_method
return request

@staticmethod
Expand Down Expand Up @@ -167,12 +165,10 @@ def _get_resource_locations(self, all_host_types):

# Last resort, make the call to the server
options_uri = self._combine_url(self.config.base_url, '_apis')
request = ClientRequest()
request.url = self._client.format_url(options_uri)
request = ClientRequest(method='OPTIONS', url=self._client.format_url(options_uri))
if all_host_types:
query_parameters = {'allHostTypes': True}
request.format_parameters(query_parameters)
request.method = 'OPTIONS'
headers = {'Accept': 'application/json'}
if self._suppress_fedauth_redirect:
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
Expand Down