You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Brian Mingus (JIRA)" <ji...@apache.org> on 2013/08/27 23:23:51 UTC
[jira] [Created] (LIBCLOUD-387) Complicated issue with vCloud
create_node and friends
Brian Mingus created LIBCLOUD-387:
-------------------------------------
Summary: Complicated issue with vCloud create_node and friends
Key: LIBCLOUD-387
URL: https://issues.apache.org/jira/browse/LIBCLOUD-387
Project: Libcloud
Issue Type: Bug
Components: Compute
Affects Versions: 0.12.3
Reporter: Brian Mingus
Creating a node doesn't work because I get the following error. I was able to get it working by patching the code as seen below.
HTTP/1.1 403 Forbidden
Date: Tue, 27 Aug 2013 19:34:59 GMT, Tue, 27 Aug 2013 19:34:59 GMT
Content-Length: 437
Content-Type: application/vnd.vmware.vcloud.error+xml;version=1.5
<?xml version="1.0" encoding="UTF-8"?>
<Error xmlns="http://www.vmware.com/vcloud/v1.5" minorErrorCode="ACCESS_TO_RESOURCE_IS_FORBIDDEN" message="No access to entity "com.vmware.vcloud.entity.network:53854fd1-f338-40a6-8285-70c69933680c"." majorErrorCode="403" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://10.132.88.240/api/v1.5/schema/master.xsd"></Error>
diff:
$ diff ./libcloud/compute/drivers/vcloud.py /Library/Python/2.7/site-packages/libcloud/compute/drivers/vcloud.py
50c50
< DEFAULT_TASK_COMPLETION_TIMEOUT = 600
---
> DEFAULT_TASK_COMPLETION_TIMEOUT = 999999
1370c1370
< network_href = self._get_network_href(ex_network)
---
> network_href = self._get_network_href(ex_network, ex_vdc)
1486,1489c1486,1496
< network_conn_xml.remove(
< network_conn_xml.find(fixxpath(network_xml, 'IpAddress')))
< network_conn_xml.remove(
< network_conn_xml.find(fixxpath(network_xml, 'MACAddress')))
---
>
> try:
> network_conn_xml.remove(
> network_conn_xml.find(fixxpath(network_xml, 'IpAddress')))
> except:
> None
> try:
> network_conn_xml.remove(
> network_conn_xml.find(fixxpath(network_xml, 'MACAddress')))
> except:
> None
1814c1821
< def _get_network_href(self, network_name):
---
> def _get_network_href(self, network_name, this_vdc=None):
1816a1824,1835
> if this_vdc is None:
> raise Exception("In order to set ex_network you must also set ex_vdc.")
>
> for vdc in self.vdcs:
> if vdc.name == this_vdc:
> res = self.connection.request(get_url_path(vdc.id)).object
> res_ents = res.findall(fixxpath(res, "AvailableNetworks/Network"))
>
> for re in res_ents:
> if re.attrib['name'] == network_name:
> network_href = re.attrib['href']
>
1818,1823c1837,1842
< res = self.connection.request(self.org)
< links = res.object.findall(fixxpath(res.object, 'Link'))
< for l in links:
< if l.attrib['type'] == 'application/vnd.vmware.vcloud.orgNetwork+xml'\
< and l.attrib['name'] == network_name:
< network_href = l.attrib['href']
---
> # res = self.connection.request(self.org)
> # links = res.object.findall(fixxpath(res.object, 'Link'))
> # for l in links:
> # if l.attrib['type'] == 'application/vnd.vmware.vcloud.orgNetwork+xml'\
> # and l.attrib['name'] == network_name:
> # network_href = l.attrib['href']
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira