libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1479041 - in /libcloud/trunk: ./ libcloud/compute/drivers/ libcloud/test/compute/ libcloud/test/compute/fixtures/vcloud_1_5/
Date Sat, 04 May 2013 05:55:30 GMT
Author: tomaz
Date: Sat May  4 05:55:30 2013
New Revision: 1479041

URL: http://svn.apache.org/r1479041
Log:
Various improvements and bug-fixes in the VCloud driver.

Contributed by Michel Samia, part of LIBCLOUD-323.

Added:
    libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml
    libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_brokenVdc.xml
Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/compute/drivers/vcloud.py
    libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml
    libcloud/trunk/libcloud/test/compute/test_vcloud.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1479041&r1=1479040&r2=1479041&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Sat May  4 05:55:30 2013
@@ -18,6 +18,9 @@ Changes with Apache Libcloud in deveplom
       (LIBCLOUD-318)
       [Michel Samia]
 
+    - Various improvements and bug-fixes in the VCloud driver. (LIBCLOUD-323)
+      [Michel Samia]
+
  *) Load Balancer
 
     - Add ex_list_current_usage method to the Rackspace driver.

Modified: libcloud/trunk/libcloud/compute/drivers/vcloud.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/vcloud.py?rev=1479041&r1=1479040&r2=1479041&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/vcloud.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/vcloud.py Sat May  4 05:55:30 2013
@@ -20,7 +20,6 @@ import sys
 import re
 import base64
 import os
-import urllib
 from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import urlencode
 from libcloud.utils.py3 import urlparse
@@ -56,7 +55,6 @@ DEFAULT_API_VERSION = '0.8'
 Valid vCloud API v1.5 input values.
 """
 VIRTUAL_CPU_VALS_1_5 = [i for i in range(1, 9)]
-VIRTUAL_MEMORY_VALS_1_5 = [2 ** i for i in range(2, 19)]
 FENCE_MODE_VALS_1_5 = ['bridged', 'isolated', 'natRouted']
 IP_MODE_VALS_1_5 = ['POOL', 'DHCP', 'MANUAL', 'NONE']
 
@@ -590,9 +588,10 @@ class VCloudNodeDriver(NodeDriver):
                 except Exception:
                     # The vApp was probably removed since the previous vDC query, ignore
                     e = sys.exc_info()[1]
-                    if not (e.args[0].tag.endswith('Error') and
+                    if not (isinstance(e.args[0], _ElementInterface) and
+                            e.args[0].tag.endswith('Error') and
                             e.args[0].get('minorErrorCode') == 'ACCESS_TO_RESOURCE_IS_FORBIDDEN'):
-                        raise e
+                        raise
 
         return nodes
 
@@ -1573,7 +1572,7 @@ class VCloud_1_5_NodeDriver(VCloudNodeDr
     def _validate_vm_memory(vm_memory):
         if vm_memory is None:
             return
-        elif vm_memory not in VIRTUAL_MEMORY_VALS_1_5:
+        elif vm_memory not in VIRTUAL_MEMORY_VALS:
             raise ValueError(
                 '%s is not a valid vApp VM memory value' % vm_memory)
 
@@ -1859,15 +1858,18 @@ class VCloud_1_5_NodeDriver(VCloudNodeDr
                     public_ips.append(external_ip.text)
                 elif ip is not None:
                     public_ips.append(ip.text)
+            os_type_elem = vm_elem.find('{http://schemas.dmtf.org/ovf/envelope/1}OperatingSystemSection')
+            if os_type_elem:
+                os_type = os_type_elem.get('{http://www.vmware.com/schema/ovf}osType')
+            else:
+                os_type = None
             vm = {
                 'id': vm_elem.get('href'),
                 'name': vm_elem.get('name'),
                 'state': self.NODE_STATE_MAP[vm_elem.get('status')],
                 'public_ips': public_ips,
                 'private_ips': private_ips,
-                'os_type': vm_elem
-                    .find('{http://schemas.dmtf.org/ovf/envelope/1}OperatingSystemSection')
-                    .get('{http://www.vmware.com/schema/ovf}osType')
+                'os_type': os_type
             }
             vms.append(vm)
 

Added: libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml?rev=1479041&view=auto
==============================================================================
--- libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml
(added)
+++ libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml
Sat May  4 05:55:30 2013
@@ -0,0 +1,290 @@
+<VApp deployed="true" status="4" name="testNode3" id="urn:vcloud:vapp:8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a"
type="application/vnd.vmware.vcloud.vApp+xml"
+      href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b" xsi:schemaLocation="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_VirtualSystemSettingData.xsd http://schemas.dmtf.org/ovf/envelope/1
http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd http://schemas.dmtf.org/ovf/environment/1
http://schemas.dmtf.org/ovf/envelope/1/dsp8027_1.1.0.xsd http://www.vmware.com/vcloud/v1.5
http://65.41.64.27/api/v1.5/schema/master.xsd http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData
http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.22.0/CIM_ResourceAllocationSettingData.xsd"
xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1"
xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData"
xmlns:vssd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSyst
 emSettingData" xmlns:ovfenv="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+   <Link rel="power:powerOff" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/power/action/powerOff"/>
+   <Link rel="power:reboot" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/power/action/reboot"/>
+   <Link rel="power:reset" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/power/action/reset"/>
+   <Link rel="power:shutdown" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/power/action/shutdown"/>
+   <Link rel="power:suspend" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/power/action/suspend"/>
+   <Link rel="deploy" type="application/vnd.vmware.vcloud.deployVAppParams+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/action/deploy"/>
+   <Link rel="undeploy" type="application/vnd.vmware.vcloud.undeployVAppParams+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/action/undeploy"/>
+   <Link rel="down" type="application/vnd.vmware.vcloud.vAppNetwork+xml" name="vCloud
- Default" href="https://vm-vcloud/api/network/da178ef6-b21b-4f19-816e-798a294d2b22"/>
+   <Link rel="down" type="application/vnd.vmware.vcloud.controlAccess+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/controlAccess/"/>
+   <Link rel="controlAccess" type="application/vnd.vmware.vcloud.controlAccess+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/action/controlAccess"/>
+   <Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0"/>
+   <Link rel="edit" type="application/vnd.vmware.vcloud.vApp+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a"/>
+   <Link rel="down" type="application/vnd.vmware.vcloud.owner+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/owner"/>
+   <Link rel="down" type="application/vnd.vmware.vcloud.metadata+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/metadata"/>
+   <Description/>
+   <LeaseSettingsSection type="application/vnd.vmware.vcloud.leaseSettingsSection+xml"
href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/leaseSettingsSection/"
ovf:required="false">
+      <ovf:Info>Lease settings section</ovf:Info>
+      <Link rel="edit" type="application/vnd.vmware.vcloud.leaseSettingsSection+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/leaseSettingsSection/"/>
+      <DeploymentLeaseInSeconds>0</DeploymentLeaseInSeconds>
+      <StorageLeaseInSeconds>0</StorageLeaseInSeconds>
+   </LeaseSettingsSection>
+   <ovf:StartupSection vcloud:href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/startupSection/"
vcloud:type="application/vnd.vmware.vcloud.startupSection+xml" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5">
+      <ovf:Info>VApp startup section</ovf:Info>
+      <ovf:Item ovf:stopDelay="0" ovf:stopAction="powerOff" ovf:startDelay="0" ovf:startAction="powerOn"
ovf:order="0" ovf:id="mgalet-test2"/>
+      <Link rel="edit" type="application/vnd.vmware.vcloud.startupSection+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/startupSection/"/>
+   </ovf:StartupSection>
+   <ovf:NetworkSection vcloud:href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/networkSection/"
vcloud:type="application/vnd.vmware.vcloud.networkSection+xml" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5">
+      <ovf:Info>The list of logical networks</ovf:Info>
+      <ovf:Network ovf:name="vCloud - Default">
+         <ovf:Description/>
+      </ovf:Network>
+   </ovf:NetworkSection>
+   <NetworkConfigSection type="application/vnd.vmware.vcloud.networkConfigSection+xml"
href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/networkConfigSection/"
ovf:required="false">
+      <ovf:Info>The configuration parameters for logical networks</ovf:Info>
+      <Link rel="edit" type="application/vnd.vmware.vcloud.networkConfigSection+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a/networkConfigSection/"/>
+      <NetworkConfig networkName="vCloud - Default">
+         <Link rel="repair" href="https://vm-vcloud/api/admin/network/da178ef6-b21b-4f19-816e-798a294d2b22/action/reset"/>
+         <Description/>
+         <Configuration>
+            <IpScope>
+               <IsInherited>true</IsInherited>
+               <Gateway>65.41.64.1</Gateway>
+               <Netmask>255.255.252.0</Netmask>
+               <Dns1>65.41.42.113</Dns1>
+               <Dns2>65.41.42.114</Dns2>
+               <DnsSuffix>vm.myorg.com</DnsSuffix>
+               <IpRanges>
+                  <IpRange>
+                     <StartAddress>65.41.67.1</StartAddress>
+                     <EndAddress>65.41.67.254</EndAddress>
+                  </IpRange>
+               </IpRanges>
+            </IpScope>
+            <ParentNetwork type="application/vnd.vmware.vcloud.network+xml" name="vCloud
- Default" href="https://vm-vcloud/api/network/dca8b667-6c8f-4c3e-be57-7a9425dba4f4"/>
+            <FenceMode>bridged</FenceMode>
+            <RetainNetInfoAcrossDeployments>false</RetainNetInfoAcrossDeployments>
+            <Features>
+               <DhcpService>
+                  <IsEnabled>false</IsEnabled>
+                  <DefaultLeaseTime>3600</DefaultLeaseTime>
+                  <MaxLeaseTime>7200</MaxLeaseTime>
+                  <IpRange>
+                     <StartAddress>65.41.64.2</StartAddress>
+                     <EndAddress>65.41.67.0</EndAddress>
+                  </IpRange>
+               </DhcpService>
+               <FirewallService>
+                  <IsEnabled>true</IsEnabled>
+                  <DefaultAction>drop</DefaultAction>
+                  <LogDefaultAction>false</LogDefaultAction>
+                  <FirewallRule>
+                     <IsEnabled>true</IsEnabled>
+                     <Description>Allow all outgoing traffic</Description>
+                     <Policy>allow</Policy>
+                     <Protocols>
+                        <Any>true</Any>
+                     </Protocols>
+                     <Port>-1</Port>
+                     <DestinationIp>Any</DestinationIp>
+                     <SourcePort>-1</SourcePort>
+                     <SourceIp>Any</SourceIp>
+                     <Direction>out</Direction>
+                     <EnableLogging>false</EnableLogging>
+                  </FirewallRule>
+               </FirewallService>
+               <NatService>
+                  <IsEnabled>true</IsEnabled>
+                  <NatType>ipTranslation</NatType>
+                  <Policy>allowTraffic</Policy>
+                  <NatRule>
+                     <OneToOneVmRule>
+                        <MappingMode>automatic</MappingMode>
+                        <VAppScopedVmId>ScrumVM_Master</VAppScopedVmId>
+                        <VmNicId>0</VmNicId>
+                     </OneToOneVmRule>
+                  </NatRule>
+               </NatService>
+               <StaticRoutingService>
+                  <IsEnabled>false</IsEnabled>
+               </StaticRoutingService>
+            </Features>
+            <SyslogServerSettings/>
+         </Configuration>
+         <IsDeployed>true</IsDeployed>
+      </NetworkConfig>
+   </NetworkConfigSection>
+   <Owner type="application/vnd.vmware.vcloud.owner+xml">
+      <User type="application/vnd.vmware.admin.user+xml" name="mgalet" href="https://vm-vcloud/api/admin/user/a0d29e8e-2b32-4739-ab7d-6a3e795be4db"/>
+   </Owner>
+   <InMaintenanceMode>false</InMaintenanceMode>
+   <Children>
+      <Vm needsCustomization="false" deployed="true" status="4" name="testVm2" id="urn:vcloud:vm:dd75d1d3-5b7b-48f0-aff3-69622ab7e045"
type="application/vnd.vmware.vcloud.vm+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e046">
+         <Link rel="power:powerOff" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/power/action/powerOff"/>
+         <Link rel="power:reboot" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/power/action/reboot"/>
+         <Link rel="power:reset" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/power/action/reset"/>
+         <Link rel="power:shutdown" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/power/action/shutdown"/>
+         <Link rel="power:suspend" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/power/action/suspend"/>
+         <Link rel="undeploy" type="application/vnd.vmware.vcloud.undeployVAppParams+xml"
href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/action/undeploy"/>
+         <Link rel="edit" type="application/vnd.vmware.vcloud.vm+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045"/>
+         <Link rel="down" type="application/vnd.vmware.vcloud.metadata+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/metadata"/>
+         <Link rel="screen:thumbnail" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/screen"/>
+         <Link rel="screen:acquireTicket" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/screen/action/acquireTicket"/>
+         <Link rel="media:insertMedia" type="application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml"
href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/media/action/insertMedia"/>
+         <Link rel="media:ejectMedia" type="application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml"
href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/media/action/ejectMedia"/>
+         <Link rel="installVmwareTools" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/action/installVMwareTools"/>
+         <Link rel="up" type="application/vnd.vmware.vcloud.vApp+xml" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a"/>
+         <Description/>
+         <ovf:VirtualHardwareSection ovf:transport="" vcloud:href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/"
vcloud:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5">
+            <ovf:Info>Virtual hardware requirements</ovf:Info>
+            <ovf:System>
+               <vssd:ElementName>Virtual Hardware Family</vssd:ElementName>
+               <vssd:InstanceID>0</vssd:InstanceID>
+               <vssd:VirtualSystemIdentifier>mgalet-test2</vssd:VirtualSystemIdentifier>
+               <vssd:VirtualSystemType>vmx-07</vssd:VirtualSystemType>
+            </ovf:System>
+            <ovf:Item>
+               <rasd:Address>00:50:56:01:00:99</rasd:Address>
+               <rasd:AddressOnParent>0</rasd:AddressOnParent>
+               <rasd:AutomaticAllocation>true</rasd:AutomaticAllocation>
+               <rasd:Connection vcloud:ipAddress="65.41.67.2" vcloud:primaryNetworkConnection="true"
vcloud:ipAddressingMode="POOL">vCloud - Default</rasd:Connection>
+               <rasd:Description>PCNet32 ethernet adapter</rasd:Description>
+               <rasd:ElementName>Network adapter 0</rasd:ElementName>
+               <rasd:InstanceID>1</rasd:InstanceID>
+               <rasd:ResourceSubType>PCNet32</rasd:ResourceSubType>
+               <rasd:ResourceType>10</rasd:ResourceType>
+            </ovf:Item>
+            <ovf:Item>
+               <rasd:Address>0</rasd:Address>
+               <rasd:Description>SCSI Controller</rasd:Description>
+               <rasd:ElementName>SCSI Controller 0</rasd:ElementName>
+               <rasd:InstanceID>2</rasd:InstanceID>
+               <rasd:ResourceSubType>lsilogic</rasd:ResourceSubType>
+               <rasd:ResourceType>6</rasd:ResourceType>
+            </ovf:Item>
+            <ovf:Item>
+               <rasd:AddressOnParent>0</rasd:AddressOnParent>
+               <rasd:Description>Hard disk</rasd:Description>
+               <rasd:ElementName>Hard disk 1</rasd:ElementName>
+               <rasd:HostResource vcloud:capacity="61440" vcloud:busSubType="lsilogic"
vcloud:busType="6"/>
+               <rasd:InstanceID>2000</rasd:InstanceID>
+               <rasd:Parent>2</rasd:Parent>
+               <rasd:ResourceType>17</rasd:ResourceType>
+            </ovf:Item>
+            <ovf:Item>
+               <rasd:Address>0</rasd:Address>
+               <rasd:Description>IDE Controller</rasd:Description>
+               <rasd:ElementName>IDE Controller 0</rasd:ElementName>
+               <rasd:InstanceID>3</rasd:InstanceID>
+               <rasd:ResourceType>5</rasd:ResourceType>
+            </ovf:Item>
+            <ovf:Item>
+               <rasd:AddressOnParent>0</rasd:AddressOnParent>
+               <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+               <rasd:Description>CD/DVD Drive</rasd:Description>
+               <rasd:ElementName>CD/DVD Drive 1</rasd:ElementName>
+               <rasd:HostResource/>
+               <rasd:InstanceID>3002</rasd:InstanceID>
+               <rasd:Parent>3</rasd:Parent>
+               <rasd:ResourceType>15</rasd:ResourceType>
+            </ovf:Item>
+            <ovf:Item>
+               <rasd:AddressOnParent>0</rasd:AddressOnParent>
+               <rasd:AutomaticAllocation>false</rasd:AutomaticAllocation>
+               <rasd:Description>Floppy Drive</rasd:Description>
+               <rasd:ElementName>Floppy Drive 1</rasd:ElementName>
+               <rasd:HostResource/>
+               <rasd:InstanceID>8000</rasd:InstanceID>
+               <rasd:ResourceType>14</rasd:ResourceType>
+            </ovf:Item>
+            <ovf:Item vcloud:href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/cpu"
vcloud:type="application/vnd.vmware.vcloud.rasdItem+xml">
+               <rasd:AllocationUnits>hertz * 10^6</rasd:AllocationUnits>
+               <rasd:Description>Number of Virtual CPUs</rasd:Description>
+               <rasd:ElementName>2 virtual CPU(s)</rasd:ElementName>
+               <rasd:InstanceID>4</rasd:InstanceID>
+               <rasd:Reservation>0</rasd:Reservation>
+               <rasd:ResourceType>3</rasd:ResourceType>
+               <rasd:VirtualQuantity>2</rasd:VirtualQuantity>
+               <rasd:Weight>0</rasd:Weight>
+               <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/cpu"/>
+            </ovf:Item>
+            <ovf:Item vcloud:href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/memory"
vcloud:type="application/vnd.vmware.vcloud.rasdItem+xml">
+               <rasd:AllocationUnits>byte * 2^20</rasd:AllocationUnits>
+               <rasd:Description>Memory Size</rasd:Description>
+               <rasd:ElementName>4096 MB of memory</rasd:ElementName>
+               <rasd:InstanceID>5</rasd:InstanceID>
+               <rasd:Reservation>0</rasd:Reservation>
+               <rasd:ResourceType>4</rasd:ResourceType>
+               <rasd:VirtualQuantity>4096</rasd:VirtualQuantity>
+               <rasd:Weight>0</rasd:Weight>
+               <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/memory"/>
+            </ovf:Item>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.virtualHardwareSection+xml"
href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/"/>
+            <Link rel="down" type="application/vnd.vmware.vcloud.rasdItem+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/cpu"/>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/cpu"/>
+            <Link rel="down" type="application/vnd.vmware.vcloud.rasdItem+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/memory"/>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItem+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/memory"/>
+            <Link rel="down" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/disks"/>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/disks"/>
+            <Link rel="down" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/media"/>
+            <Link rel="down" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/networkCards"/>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/networkCards"/>
+            <Link rel="down" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/serialPorts"/>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.rasdItemsList+xml" href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/virtualHardwareSection/serialPorts"/>
+         </ovf:VirtualHardwareSection>
+          <NetworkConnectionSection type="application/vnd.vmware.vcloud.networkConnectionSection+xml"
href="https://vm-vcloud/api/vApp/vm-cbfe57d5-7362-482b-b313-e5b5bcff3309/networkConnectionSection/"
ovf:required="false">
+              <ovf:Info>Specifies the available VM network connections</ovf:Info>
+              <PrimaryNetworkConnectionIndex>0</PrimaryNetworkConnectionIndex>
+              <NetworkConnection network="mgalet-test-network" needsCustomization="true">
+                  <NetworkConnectionIndex>0</NetworkConnectionIndex>
+                  <IpAddress>192.168.0.100</IpAddress>
+                  <ExternalIpAddress>192.168.0.103</ExternalIpAddress>
+                  <IsConnected>true</IsConnected>
+                  <MACAddress>00:50:56:01:00:d9</MACAddress>
+                  <IpAddressAllocationMode>POOL</IpAddressAllocationMode>
+              </NetworkConnection>
+          </NetworkConnectionSection>
+          <GuestCustomizationSection type="application/vnd.vmware.vcloud.guestCustomizationSection+xml"
href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/guestCustomizationSection/"
ovf:required="false">
+            <ovf:Info>Specifies Guest OS Customization Settings</ovf:Info>
+            <Enabled>true</Enabled>
+            <ChangeSid>false</ChangeSid>
+            <VirtualMachineId>dd75d1d3-5b7b-48f0-aff3-69622ab7e045</VirtualMachineId>
+            <JoinDomainEnabled>false</JoinDomainEnabled>
+            <UseOrgSettings>false</UseOrgSettings>
+            <AdminPasswordEnabled>true</AdminPasswordEnabled>
+            <AdminPasswordAuto>true</AdminPasswordAuto>
+            <AdminPassword>sN#9QH9#</AdminPassword>
+            <ResetPasswordRequired>false</ResetPasswordRequired>
+            <ComputerName>mgalet-test2</ComputerName>
+            <Link rel="edit" type="application/vnd.vmware.vcloud.guestCustomizationSection+xml"
href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/guestCustomizationSection/"/>
+         </GuestCustomizationSection>
+         <RuntimeInfoSection vcloud:href="https://vm-vcloud/api/vApp/vm-dd75d1d3-5b7b-48f0-aff3-69622ab7e045/runtimeInfoSection"
vcloud:type="application/vnd.vmware.vcloud.virtualHardwareSection+xml" xmlns:vcloud="http://www.vmware.com/vcloud/v1.5">
+            <ovf:Info>Specifies Runtime info</ovf:Info>
+            <VMWareTools version="8290"/>
+         </RuntimeInfoSection>
+         <VAppScopedLocalId>ScrumVM_Master</VAppScopedLocalId>
+         <ovfenv:Environment ovfenv:id="" ns8:vCenterId="vm-139" xmlns:ns8="http://www.vmware.com/schema/ovfenv">
+            <ovfenv:PlatformSection>
+               <ovfenv:Kind>VMware ESXi</ovfenv:Kind>
+               <ovfenv:Version>5.0.0</ovfenv:Version>
+               <ovfenv:Vendor>VMware, Inc.</ovfenv:Vendor>
+               <ovfenv:Locale>en</ovfenv:Locale>
+            </ovfenv:PlatformSection>
+            <ovfenv:PropertySection>
+               <ovfenv:Property ovfenv:value="None" ovfenv:key="vCloud_UseSysPrep"/>
+               <ovfenv:Property ovfenv:value="sN#9QH9#" ovfenv:key="vCloud_adminPassword"/>
+               <ovfenv:Property ovfenv:value="1" ovfenv:key="vCloud_bitMask"/>
+               <ovfenv:Property ovfenv:value="static" ovfenv:key="vCloud_bootproto_0"/>
+               <ovfenv:Property ovfenv:value="mgalet-test2" ovfenv:key="vCloud_computerName"/>
+               <ovfenv:Property ovfenv:value="65.41.42.113" ovfenv:key="vCloud_dns1_0"/>
+               <ovfenv:Property ovfenv:value="65.41.42.114" ovfenv:key="vCloud_dns2_0"/>
+               <ovfenv:Property ovfenv:value="65.41.64.1" ovfenv:key="vCloud_gateway_0"/>
+               <ovfenv:Property ovfenv:value="65.41.67.2" ovfenv:key="vCloud_ip_0"/>
+               <ovfenv:Property ovfenv:value="00:50:56:01:00:99" ovfenv:key="vCloud_macaddr_0"/>
+               <ovfenv:Property ovfenv:value="83467e6d-0af8-4af5-8b15-b8d107b16f0d" ovfenv:key="vCloud_markerid"/>
+               <ovfenv:Property ovfenv:value="255.255.252.0" ovfenv:key="vCloud_netmask_0"/>
+               <ovfenv:Property ovfenv:value="1" ovfenv:key="vCloud_numnics"/>
+               <ovfenv:Property ovfenv:value="0" ovfenv:key="vCloud_primaryNic"/>
+               <ovfenv:Property ovfenv:value="117274554" ovfenv:key="vCloud_reconfigToken"/>
+               <ovfenv:Property ovfenv:value="0" ovfenv:key="vCloud_resetPassword"/>
+               <ovfenv:Property ovfenv:value="vm.myorg.com" ovfenv:key="vCloud_suffix_0"/>
+            </ovfenv:PropertySection>
+            <ve:EthernetAdapterSection xmlns:ve="http://www.vmware.com/schema/ovfenv"
xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1">
+               <ve:Adapter ve:mac="00:50:56:01:00:99" ve:network="VM Network" ve:unitNumber="7"/>
+            </ve:EthernetAdapterSection>
+         </ovfenv:Environment>
+      </Vm>
+   </Children>
+</VApp>

Modified: libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml?rev=1479041&r1=1479040&r2=1479041&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml
(original)
+++ libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml
Sat May  4 05:55:30 2013
@@ -36,6 +36,7 @@
    <ResourceEntities>
       <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="testNode" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a"/>
       <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="testNode2" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b"/>
+      <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="testNode3" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6c"/>
       <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="deleted-test"
href="https://vm-vcloud/api/vApp/vapp-access-to-resource-forbidden"/>
       <ResourceEntity type="application/vnd.vmware.vcloud.vAppTemplate+xml" name="VMTemplate_Master"
href="https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158"/>
    </ResourceEntities>
@@ -53,4 +54,4 @@
    <NetworkQuota>1024</NetworkQuota>
    <VmQuota>150</VmQuota>
    <IsEnabled>true</IsEnabled>
-</Vdc>
\ No newline at end of file
+</Vdc>

Added: libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_brokenVdc.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_brokenVdc.xml?rev=1479041&view=auto
==============================================================================
--- libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_brokenVdc.xml (added)
+++ libcloud/trunk/libcloud/test/compute/fixtures/vcloud_1_5/api_vdc_brokenVdc.xml Sat May
 4 05:55:30 2013
@@ -0,0 +1,56 @@
+<Vdc status="1" name="MyVdc" id="urn:vcloud:vdc:3d9ae28c-1de9-4307-8107-9356ff8ba6d0"
type="application/vnd.vmware.vcloud.vdc+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0"
xsi:schemaLocation="http://www.vmware.com/vcloud/v1.5 http://65.41.64.27/api/v1.5/schema/master.xsd"
xmlns="http://www.vmware.com/vcloud/v1.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+   <Link rel="up" type="application/vnd.vmware.vcloud.org+xml" href="https://vm-vcloud/api/org/96726c78-4ae3-402f-b08b-7a78c6903d2a"/>
+   <Link rel="down" type="application/vnd.vmware.vcloud.metadata+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/metadata"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/uploadVAppTemplate"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.media+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/media"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml"
href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/instantiateVAppTemplate"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.cloneVAppParams+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/cloneVApp"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/cloneVAppTemplate"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.cloneMediaParams+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/cloneMedia"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.captureVAppParams+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/captureVApp"/>
+   <Link rel="add" type="application/vnd.vmware.vcloud.composeVAppParams+xml" href="https://vm-vcloud/api/vdc/3d9ae28c-1de9-4307-8107-9356ff8ba6d0/action/composeVApp"/>
+   <AllocationModel>AllocationPool</AllocationModel>
+   <StorageCapacity>
+      <Units>MB</Units>
+      <Allocated>5120000</Allocated>
+      <Limit>5120000</Limit>
+      <Used>1984512</Used>
+      <Overhead>0</Overhead>
+   </StorageCapacity>
+   <ComputeCapacity>
+      <Cpu>
+         <Units>MHz</Units>
+         <Allocated>130000</Allocated>
+         <Limit>160000</Limit>
+         <Used>0</Used>
+         <Overhead>0</Overhead>
+      </Cpu>
+      <Memory>
+         <Units>MB</Units>
+         <Allocated>527360</Allocated>
+         <Limit>527360</Limit>
+         <Used>130752</Used>
+         <Overhead>0</Overhead>
+      </Memory>
+   </ComputeCapacity>
+   <ResourceEntities>
+      <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="testNode" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6a"/>
+      <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="testNode2" href="https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b"/>
+      <ResourceEntity type="application/vnd.vmware.vcloud.vApp+xml" name="deleted-test"
href="https://vm-vcloud/api/vApp/vapp-errorRaiser"/>
+      <ResourceEntity type="application/vnd.vmware.vcloud.vAppTemplate+xml" name="VMTemplate_Master"
href="https://vm-vcloud/api/vAppTemplate/vappTemplate-ac1bc027-bf8c-4050-8643-4971f691c158"/>
+   </ResourceEntities>
+   <AvailableNetworks>
+      <Network type="application/vnd.vmware.vcloud.network+xml" name="vCloud - Default"
href="https://vm-vcloud/api/network/dca8b667-6c8f-4c3e-be57-7a9425dba4f4"/>
+   </AvailableNetworks>
+   <Capabilities>
+      <SupportedHardwareVersions>
+         <SupportedHardwareVersion>vmx-04</SupportedHardwareVersion>
+         <SupportedHardwareVersion>vmx-07</SupportedHardwareVersion>
+         <SupportedHardwareVersion>vmx-08</SupportedHardwareVersion>
+      </SupportedHardwareVersions>
+   </Capabilities>
+   <NicQuota>0</NicQuota>
+   <NetworkQuota>1024</NetworkQuota>
+   <VmQuota>150</VmQuota>
+   <IsEnabled>true</IsEnabled>
+</Vdc>

Modified: libcloud/trunk/libcloud/test/compute/test_vcloud.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/test_vcloud.py?rev=1479041&r1=1479040&r2=1479041&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/test_vcloud.py (original)
+++ libcloud/trunk/libcloud/test/compute/test_vcloud.py Sat May  4 05:55:30 2013
@@ -22,6 +22,7 @@ from libcloud.utils.py3 import httplib, 
 from libcloud.compute.drivers.vcloud import TerremarkDriver, VCloudNodeDriver, Subject
 from libcloud.compute.drivers.vcloud import VCloud_1_5_NodeDriver, ControlAccess
 from libcloud.compute.drivers.vcloud import VCloud_5_1_NodeDriver
+from libcloud.compute.drivers.vcloud import Vdc
 from libcloud.compute.base import Node, NodeImage
 from libcloud.compute.types import NodeState
 
@@ -242,6 +243,13 @@ class VCloud_1_5_Tests(unittest.TestCase
     def test_ex_list_nodes(self):
         self.assertEqual(len(self.driver.ex_list_nodes()), len(self.driver.list_nodes()))
 
+    def test_ex_list_nodes__masked_exception(self):
+        """
+        Test that we don't mask other exceptions.
+        """
+        brokenVdc = Vdc('/api/vdc/brokenVdc', 'brokenVdc', self.driver)
+        self.assertRaises(AnotherError, self.driver.ex_list_nodes, (brokenVdc))
+
     def test_ex_power_off(self):
         node = Node('https://vm-vcloud/api/vApp/vapp-8c57a5b6-e61b-48ca-8a78-3b70ee65ef6b',
'testNode', NodeState.RUNNING, [], [], self.driver)
         self.driver.ex_power_off_node(node)
@@ -398,6 +406,21 @@ class TerremarkMockHttp(MockHttp):
         return (httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED])
 
 
+class AnotherErrorMember(Exception):
+    """
+    helper class for the synthetic exception
+    """
+
+    def __init__(self):
+        self.tag = 'Error'
+
+    def get(self, foo):
+        return 'ACCESS_TO_RESOURCE_IS_FORBIDDEN'
+
+class AnotherError(Exception):
+    pass
+
+
 class VCloud_1_5_MockHttp(MockHttp, unittest.TestCase):
 
     fixtures = ComputeFileFixtures('vcloud_1_5')
@@ -430,6 +453,14 @@ class VCloud_1_5_MockHttp(MockHttp, unit
         body = self.fixtures.load('api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0.xml')
         return httplib.OK, body, headers, httplib.responses[httplib.OK]
 
+    def _api_vdc_brokenVdc(self, method, url, body, headers):
+        body = self.fixtures.load('api_vdc_brokenVdc.xml')
+        return httplib.OK, body, headers, httplib.responses[httplib.OK]
+
+    def _api_vApp_vapp_errorRaiser(self, method, url, body, headers):
+        m = AnotherErrorMember()
+        raise AnotherError(m)
+
     def _api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_instantiateVAppTemplate(self,
method, url, body, headers):
         body = self.fixtures.load('api_vdc_3d9ae28c_1de9_4307_8107_9356ff8ba6d0_action_instantiateVAppTemplate.xml')
         return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]
@@ -460,6 +491,10 @@ class VCloud_1_5_MockHttp(MockHttp, unit
         body = self.fixtures.load('api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6b.xml')
         return httplib.OK, body, headers, httplib.responses[httplib.OK]
 
+    def _api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c(self, method, url, body, headers):
+        body = self.fixtures.load('api_vApp_vapp_8c57a5b6_e61b_48ca_8a78_3b70ee65ef6c.xml')
+        return httplib.OK, body, headers, httplib.responses[httplib.OK]
+
     def _api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045(self, method, url, body, headers):
         body = self.fixtures.load('put_api_vApp_vm_dd75d1d3_5b7b_48f0_aff3_69622ab7e045_guestCustomizationSection.xml')
         return httplib.ACCEPTED, body, headers, httplib.responses[httplib.ACCEPTED]



Mime
View raw message