Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
fixed service type identification
Browse files Browse the repository at this point in the history
  • Loading branch information
pacogomez committed Dec 31, 2015
1 parent bc8054a commit 213af85
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyvcloud/vcloudair.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def get_service_type(self):
headers = {}
headers["Accept"] = "application/json;version=" + '5.7'
response = Http.post(url, headers=headers, auth=('_', '_'), verify=self.verify, logger=self.logger)
if response.status_code == requests.codes.unauthorized:
if response.status_code != 404:
return VCA.VCA_SERVICE_TYPE_VCA
url = self.host + '/api/vchs/sessions'
headers = {}
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ netaddr>=0.7.13
requests>=2.4.3
PyYAML==3.10
progressbar>=2.3
cloudify-dsl-parser>=3.2
cloudify-dsl-parser==3.2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def read(fname):

setup(
name='pyvcloud',
version='15rc1',
version='15rc2',
description='VMware vCloud Python SDK',
long_description=read('README.rst'),
url='https://github.com/vmware/pyvcloud',
Expand Down

3 comments on commit 213af85

@ckamps
Copy link

@ckamps ckamps commented on 213af85 Jan 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change in how the service is identified broke support for vcd. The code now misidentifies a vcd 5.5 service as TYPE_VCA. Consequently, the subsequent login attempt fails.

@pacogomez
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please let me know what the status code you get for $HOST/api/iam/login on your VCD instance?

@ckamps
Copy link

@ckamps ckamps commented on 213af85 Jan 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ curl --insecure https://$HOST/api/iam/login
<?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="NOT_ACCEPTABLE" message="The request has invalid accept header. Supported API versions are: [1.5, 5.1, 5.5]" majorErrorCode="406" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://$HOST/api/v1.5/schema/master.xsd"></Error>

As this issue is fixed, would it be feasible to also address the following issue? It forces us to hack at the code to get vca-cli and pyvcloud to work when there are zero edge gateways defined. Which is a valid vCD configuration.

Here's the symptom as it manifests itself in vca-cli, but the underlying cause is in pyvcloud. The fix is a simple one line change to guard against attempting to use an empty list of edge gateways:

vca-cli issue 30

and the corresponding issue in pyvcloud #85

Please sign in to comment.