libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1364880 - in /libcloud/trunk: ./ libcloud/common/ libcloud/compute/drivers/ libcloud/test/compute/ libcloud/test/compute/fixtures/gandi/
Date Tue, 24 Jul 2012 04:26:52 GMT
Author: tomaz
Date: Tue Jul 24 04:26:51 2012
New Revision: 1364880

URL: http://svn.apache.org/viewvc?rev=1364880&view=rev
Log:
Add methods for managing storage volumes to the Gandi driver. Contributed by
Aymeric Barantal, part of LIBCLOUD-225.

Added:
    libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_create.xml
    libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_delete.xml
    libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_info.xml
Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/common/gandi.py
    libcloud/trunk/libcloud/compute/drivers/gandi.py
    libcloud/trunk/libcloud/test/compute/test_gandi.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1364880&r1=1364879&r2=1364880&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Tue Jul 24 04:26:51 2012
@@ -81,6 +81,10 @@ Changes with Apache Libcloud in developm
       LIBCLOUD-223
       [Amir Elaguizy]
 
+    - Add methods for managing storage volumes to the Gandi driver. ;
+      LIBCLOUD-225
+      [Aymeric Barantal]
+
   *) DNS
 
     - Add support for GEO RecordType to Zerigo driver. ; LIBCLOUD-203

Modified: libcloud/trunk/libcloud/common/gandi.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/common/gandi.py?rev=1364880&r1=1364879&r2=1364880&view=diff
==============================================================================
--- libcloud/trunk/libcloud/common/gandi.py (original)
+++ libcloud/trunk/libcloud/common/gandi.py Tue Jul 24 04:26:51 2012
@@ -26,8 +26,8 @@ from libcloud.utils.py3 import b
 from libcloud.common.base import ConnectionKey
 
 # Global constants
-API_VERSION = '2.0'
-API_PREFIX = "https://rpc.gandi.net/xmlrpc/%s/" % API_VERSION
+
+API_URL = "https://rpc.gandi.net/xmlrpc/"
 
 DEFAULT_TIMEOUT = 600   # operation pooling max seconds
 DEFAULT_INTERVAL = 20   # seconds between 2 operation.info
@@ -57,13 +57,13 @@ class GandiProxy(xmlrpclib.ServerProxy):
 
     def __init__(self, user_agent, verbose=0):
         cls = self.transportCls[0]
-        if API_PREFIX.startswith("https://"):
+        if API_URL.startswith("https://"):
             cls = self.transportCls[1]
         t = cls(use_datetime=0)
         t.user_agent = user_agent
         xmlrpclib.ServerProxy.__init__(
             self,
-            uri="%s" % (API_PREFIX),
+            uri=API_URL,
             transport=t,
             verbose=verbose,
             allow_none=True

Modified: libcloud/trunk/libcloud/compute/drivers/gandi.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/drivers/gandi.py?rev=1364880&r1=1364879&r2=1364880&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/drivers/gandi.py (original)
+++ libcloud/trunk/libcloud/compute/drivers/gandi.py Tue Jul 24 04:26:51 2012
@@ -20,6 +20,7 @@ from datetime import datetime
 
 from libcloud.common.gandi import BaseGandiDriver, GandiException,\
     NetworkInterface, IPAddress, Disk
+from libcloud.compute.base import StorageVolume
 from libcloud.compute.types import NodeState, Provider
 from libcloud.compute.base import Node, NodeDriver
 from libcloud.compute.base import NodeSize, NodeImage, NodeLocation
@@ -52,15 +53,21 @@ class GandiNodeDriver(BaseGandiDriver, N
     # TODO : which features to enable ?
     features = {}
 
-    def _node_info(self, id):
+    def _resource_info(self, type, id):
         try:
-            obj = self.connection.request('vm.info', int(id))
+            obj = self.connection.request('%s.info' % type, int(id))
             return obj
         except Exception:
             e = sys.exc_info()[1]
             raise GandiException(1003, e)
         return None
 
+    def _node_info(self, id):
+        return self._resource_info('vm', id)
+
+    def _volume_info(self, id):
+        return self._resource_info('disk', id)
+
     # Generic methods for driver
     def _to_node(self, vm):
         return Node(
@@ -83,6 +90,54 @@ class GandiNodeDriver(BaseGandiDriver, N
     def _to_nodes(self, vms):
         return [self._to_node(v) for v in vms]
 
+    def _to_volume(self, disk):
+        extra = {'can_snapshot': disk['can_snapshot']}
+        return StorageVolume(
+            id=disk['id'],
+            name=disk['name'],
+            size=int(disk['size']),
+            driver=self,
+            extra=extra)
+
+    def _to_volumes(self, disks):
+        return [self._to_volume(d) for d in disks]
+
+    def _to_volume(self, disk):
+        extra = {'can_snapshot': disk['can_snapshot']}
+        return StorageVolume(
+            id=disk['id'],
+            name=disk['name'],
+            size=int(disk['size']),
+            driver=self,
+            extra=extra)
+
+    def _to_volumes(self, disks):
+        return [self._to_volume(d) for d in disks]
+
+    def _to_volume(self, disk):
+        extra = {'can_snapshot': disk['can_snapshot']}
+        return StorageVolume(
+            id=disk['id'],
+            name=disk['name'],
+            size=int(disk['size']),
+            driver=self,
+            extra=extra)
+
+    def _to_volumes(self, disks):
+        return [self._to_volume(d) for d in disks]
+
+    def _to_volume(self, disk):
+        extra = {'can_snapshot': disk['can_snapshot']}
+        return StorageVolume(
+            id=disk['id'],
+            name=disk['name'],
+            size=int(disk['size']),
+            driver=self,
+            extra=extra)
+
+    def _to_volumes(self, disks):
+        return [self._to_volume(d) for d in disks]
+
     def list_nodes(self):
         vms = self.connection.request('vm.list')
         ips = self.connection.request('ip.list')
@@ -100,7 +155,7 @@ class GandiNodeDriver(BaseGandiDriver, N
     def reboot_node(self, node):
         op = self.connection.request('vm.reboot', int(node.id))
         self._wait_operation(op['id'])
-        vm = self.connection.request('vm.info', int(node.id))
+        vm = self._node_info(int(node.id))
         if vm['state'] == 'running':
             return True
         return False
@@ -284,6 +339,178 @@ class GandiNodeDriver(BaseGandiDriver, N
         res = self.connection.request("datacenter.list")
         return [self._to_loc(l) for l in res]
 
+    def list_volumes(self):
+        """List all volumes"""
+        res = self.connection.request('disk.list', {})
+        return self._to_volumes(res)
+
+    def create_volume(self, size, name, location=None, snapshot=None):
+        disk_param = {
+            'name': name,
+            'size': int(size),
+            'datacenter_id': int(location.id)
+        }
+        if snapshot:
+            op = self.connection.request('disk.create_from',
+                disk_param, int(snapshot.id))
+        else:
+            op = self.connection.request('disk.create', disk_param)
+        if self._wait_operation(op['id']):
+            disk = self._volume_info(op['disk_id'])
+            return self._to_volume(disk)
+        return None
+
+    def attach_volume(self, node, volume, device=None):
+        """Attach a volume to a node"""
+        op = self.connection.request('vm.disk_attach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def detach_volume(self, node, volume):
+        """Detach a volume from a node"""
+        op = self.connection.request('vm.disk_detach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def destroy_volume(self, volume):
+        op = self.connection.request('disk.delete', int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def list_volumes(self):
+        """List all volumes"""
+        res = self.connection.request('disk.list', {})
+        return self._to_volumes(res)
+
+    def create_volume(self, size, name, location=None, snapshot=None):
+        disk_param = {
+            'name': name,
+            'size': int(size),
+            'datacenter_id': int(location.id)
+        }
+        if snapshot:
+            op = self.connection.request('disk.create_from',
+                disk_param, int(snapshot.id))
+        else:
+            op = self.connection.request('disk.create', disk_param)
+        if self._wait_operation(op['id']):
+            disk = self._volume_info(op['disk_id'])
+            return self._to_volume(disk)
+        return None
+
+    def attach_volume(self, node, volume, device=None):
+        """Attach a volume to a node"""
+        op = self.connection.request('vm.disk_attach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def detach_volume(self, node, volume):
+        """Detach a volume from a node"""
+        op = self.connection.request('vm.disk_detach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def destroy_volume(self, volume):
+        op = self.connection.request('disk.delete', int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def list_volumes(self):
+        """List all volumes"""
+        res = self.connection.request('disk.list', {})
+        return self._to_volumes(res)
+
+    def create_volume(self, size, name, location=None, snapshot=None):
+        disk_param = {
+            'name': name,
+            'size': int(size),
+            'datacenter_id': int(location.id)
+        }
+        if snapshot:
+            op = self.connection.request('disk.create_from',
+                disk_param, int(snapshot.id))
+        else:
+            op = self.connection.request('disk.create', disk_param)
+        if self._wait_operation(op['id']):
+            disk = self._volume_info(op['disk_id'])
+            return self._to_volume(disk)
+        return None
+
+    def attach_volume(self, node, volume, device=None):
+        """Attach a volume to a node"""
+        op = self.connection.request('vm.disk_attach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def detach_volume(self, node, volume):
+        """Detach a volume from a node"""
+        op = self.connection.request('vm.disk_detach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def destroy_volume(self, volume):
+        op = self.connection.request('disk.delete', int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def list_volumes(self):
+        """List all volumes"""
+        res = self.connection.request('disk.list', {})
+        return self._to_volumes(res)
+
+    def create_volume(self, size, name, location=None, snapshot=None):
+        disk_param = {
+            'name': name,
+            'size': int(size),
+            'datacenter_id': int(location.id)
+        }
+        if snapshot:
+            op = self.connection.request('disk.create_from',
+                disk_param, int(snapshot.id))
+        else:
+            op = self.connection.request('disk.create', disk_param)
+        if self._wait_operation(op['id']):
+            disk = self._volume_info(op['disk_id'])
+            return self._to_volume(disk)
+        return None
+
+    def attach_volume(self, node, volume, device=None):
+        """Attach a volume to a node"""
+        op = self.connection.request('vm.disk_attach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def detach_volume(self, node, volume):
+        """Detach a volume from a node"""
+        op = self.connection.request('vm.disk_detach',
+            int(node.id), int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
+    def destroy_volume(self, volume):
+        op = self.connection.request('disk.delete', int(volume.id))
+        if self._wait_operation(op['id']):
+            return True
+        return False
+
     def _to_iface(self, iface):
         ips = []
         for ip in iface.get('ips', []):

Added: libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_create.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_create.xml?rev=1364880&view=auto
==============================================================================
--- libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_create.xml (added)
+++ libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_create.xml Tue Jul 24 04:26:51
2012
@@ -0,0 +1,49 @@
+<?xml version='1.0'?>
+<methodResponse>
+<params>
+<param>
+<value><struct>
+<member>
+<name>iface_id</name>
+<value><nil/></value></member>
+<member>
+<name>date_updated</name>
+<value><dateTime.iso8601>20120629T11:48:20</dateTime.iso8601></value>
+</member>
+<member>
+<name>vm_id</name>
+<value><nil/></value></member>
+<member>
+<name>date_start</name>
+<value><nil/></value></member>
+<member>
+<name>disk_id</name>
+<value><int>1263</int></value>
+</member>
+<member>
+<name>source</name>
+<value><string>AB3917-GANDI</string></value>
+</member>
+<member>
+<name>step</name>
+<value><string>DONE</string></value>
+</member>
+<member>
+<name>ip_id</name>
+<value><nil/></value></member>
+<member>
+<name>date_created</name>
+<value><dateTime.iso8601>20120629T11:48:20</dateTime.iso8601></value>
+</member>
+<member>
+<name>type</name>
+<value><string>disk_create</string></value>
+</member>
+<member>
+<name>id</name>
+<value><int>10895</int></value>
+</member>
+</struct></value>
+</param>
+</params>
+</methodResponse>
\ No newline at end of file

Added: libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_delete.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_delete.xml?rev=1364880&view=auto
==============================================================================
--- libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_delete.xml (added)
+++ libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_delete.xml Tue Jul 24 04:26:51
2012
@@ -0,0 +1,49 @@
+<?xml version='1.0'?>
+<methodResponse>
+<params>
+<param>
+<value><struct>
+<member>
+<name>iface_id</name>
+<value><nil/></value></member>
+<member>
+<name>date_updated</name>
+<value><dateTime.iso8601>20120629T11:47:06</dateTime.iso8601></value>
+</member>
+<member>
+<name>vm_id</name>
+<value><nil/></value></member>
+<member>
+<name>date_start</name>
+<value><nil/></value></member>
+<member>
+<name>disk_id</name>
+<value><int>1262</int></value>
+</member>
+<member>
+<name>source</name>
+<value><string>AB3917-GANDI</string></value>
+</member>
+<member>
+<name>step</name>
+<value><string>WAIT</string></value>
+</member>
+<member>
+<name>ip_id</name>
+<value><nil/></value></member>
+<member>
+<name>date_created</name>
+<value><dateTime.iso8601>20120629T11:47:06</dateTime.iso8601></value>
+</member>
+<member>
+<name>type</name>
+<value><string>disk_delete</string></value>
+</member>
+<member>
+<name>id</name>
+<value><int>10894</int></value>
+</member>
+</struct></value>
+</param>
+</params>
+</methodResponse>
\ No newline at end of file

Added: libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_info.xml
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_info.xml?rev=1364880&view=auto
==============================================================================
--- libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_info.xml (added)
+++ libcloud/trunk/libcloud/test/compute/fixtures/gandi/disk_info.xml Tue Jul 24 04:26:51
2012
@@ -0,0 +1,73 @@
+<?xml version='1.0'?>
+<methodResponse>
+<params>
+<param>
+<value><struct>
+<member>
+<name>datacenter_id</name>
+<value><int>1</int></value>
+</member>
+<member>
+<name>name</name>
+<value><string>libcloud</string></value>
+</member>
+<member>
+<name>snapshot_profile</name>
+<value><nil/></value></member>
+<member>
+<name>kernel_version</name>
+<value><nil/></value></member>
+<member>
+<name>can_snapshot</name>
+<value><boolean>1</boolean></value>
+</member>
+<member>
+<name>kernel_cmdline</name>
+<value><nil/></value></member>
+<member>
+<name>visibility</name>
+<value><string>private</string></value>
+</member>
+<member>
+<name>label</name>
+<value><nil/></value></member>
+<member>
+<name>vms_id</name>
+<value><array><data>
+</data></array></value>
+</member>
+<member>
+<name>source</name>
+<value><nil/></value></member>
+<member>
+<name>state</name>
+<value><string>created</string></value>
+</member>
+<member>
+<name>is_boot_disk</name>
+<value><boolean>0</boolean></value>
+</member>
+<member>
+<name>date_updated</name>
+<value><dateTime.iso8601>20120629T11:49:00</dateTime.iso8601></value>
+</member>
+<member>
+<name>date_created</name>
+<value><dateTime.iso8601>20120629T11:48:20</dateTime.iso8601></value>
+</member>
+<member>
+<name>type</name>
+<value><string>data</string></value>
+</member>
+<member>
+<name>id</name>
+<value><int>1263</int></value>
+</member>
+<member>
+<name>size</name>
+<value><int>1024</int></value>
+</member>
+</struct></value>
+</param>
+</params>
+</methodResponse>
\ No newline at end of file

Modified: libcloud/trunk/libcloud/test/compute/test_gandi.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/test/compute/test_gandi.py?rev=1364880&r1=1364879&r2=1364880&view=diff
==============================================================================
--- libcloud/trunk/libcloud/test/compute/test_gandi.py (original)
+++ libcloud/trunk/libcloud/test/compute/test_gandi.py Tue Jul 24 04:26:51 2012
@@ -22,6 +22,7 @@ from libcloud.utils.py3 import httplib
 from libcloud.utils.py3 import xmlrpclib
 
 from libcloud.compute.drivers.gandi import GandiNodeDriver as Gandi
+from libcloud.compute.base import StorageVolume
 from libcloud.common.gandi import GandiException
 from libcloud.compute.types import NodeState
 
@@ -109,10 +110,36 @@ class GandiTests(unittest.TestCase):
             password=passwd, image=img, location=loc, size=size)
         self.assertEqual(node.name, self.node_name)
 
-    def test_ex_list_disks(self):
-        disks = self.driver.ex_list_disks()
+    def test_create_volume(self):
+        loc = list(filter(lambda x: 'france' in x.country.lower(),
+            self.driver.list_locations()))[0]
+        volume = self.driver.create_volume(
+            size=1024, name='libcloud', location=loc)
+        self.assertEqual(volume.name, 'libcloud')
+        self.assertEqual(volume.size, 1024)
+
+    def test_list_volumes(self):
+        disks = self.driver.list_volumes()
         self.assertTrue(len(disks) > 0)
 
+    def test_destroy_volume(self):
+        volumes = self.driver.list_volumes()
+        test_vol = list(filter(lambda x: x.name == 'test_disk',
+                                volumes))[0]
+        self.assertTrue(self.driver.destroy_volume(test_vol))
+
+    def test_attach_volume(self):
+        disks = self.driver.list_volumes()
+        nodes = self.driver.list_nodes()
+        res = self.driver.attach_volume(nodes[0], disks[0])
+        self.assertTrue(res)
+
+    def test_detach_volume(self):
+        disks = self.driver.list_volumes()
+        nodes = self.driver.list_nodes()
+        res = self.driver.detach_volume(nodes[0], disks[0])
+        self.assertTrue(res)
+
     def test_ex_list_interfaces(self):
         ifaces = self.driver.ex_list_interfaces()
         self.assertTrue(len(ifaces) > 0)
@@ -129,26 +156,14 @@ class GandiTests(unittest.TestCase):
         res = self.driver.ex_node_detach_interface(nodes[0], ifaces[0])
         self.assertTrue(res)
 
-    def test_ex_attach_disk(self):
-        disks = self.driver.ex_list_disks()
-        nodes = self.driver.list_nodes()
-        res = self.driver.ex_node_attach_disk(nodes[0], disks[0])
-        self.assertTrue(res)
-
-    def test_ex_detach_disk(self):
-        disks = self.driver.ex_list_disks()
-        nodes = self.driver.list_nodes()
-        res = self.driver.ex_node_detach_disk(nodes[0], disks[0])
-        self.assertTrue(res)
-
     def test_ex_snapshot_disk(self):
-        disks = self.driver.ex_list_disks()
+        disks = self.driver.list_volumes()
         self.assertTrue(self.driver.ex_snapshot_disk(disks[2]))
         self.assertRaises(GandiException,
             self.driver.ex_snapshot_disk, disks[0])
 
     def test_ex_update_disk(self):
-        disks = self.driver.ex_list_disks()
+        disks = self.driver.list_volumes()
         self.assertTrue(self.driver.ex_update_disk(disks[0], new_size=4096))
 
 
@@ -156,80 +171,92 @@ class GandiMockHttp(MockHttp):
 
     fixtures = ComputeFileFixtures('gandi')
 
-    def _xmlrpc_2_0__datacenter_list(self, method, url, body, headers):
+    def _xmlrpc__datacenter_list(self, method, url, body, headers):
         body = self.fixtures.load('datacenter_list.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__image_list(self, method, url, body, headers):
+    def _xmlrpc__image_list(self, method, url, body, headers):
         body = self.fixtures.load('image_list_dc0.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_list(self, method, url, body, headers):
+    def _xmlrpc__vm_list(self, method, url, body, headers):
         body = self.fixtures.load('vm_list.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__ip_list(self, method, url, body, headers):
+    def _xmlrpc__ip_list(self, method, url, body, headers):
         body = self.fixtures.load('ip_list.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__account_info(self, method, url, body, headers):
+    def _xmlrpc__account_info(self, method, url, body, headers):
         body = self.fixtures.load('account_info.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_info(self, method, url, body, headers):
+    def _xmlrpc__vm_info(self, method, url, body, headers):
         body = self.fixtures.load('vm_info.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_delete(self, method, url, body, headers):
+    def _xmlrpc__vm_delete(self, method, url, body, headers):
         body = self.fixtures.load('vm_delete.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__operation_info(self, method, url, body, headers):
+    def _xmlrpc__operation_info(self, method, url, body, headers):
         body = self.fixtures.load('operation_info.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_create_from(self, method, url, body, headers):
+    def _xmlrpc__vm_create_from(self, method, url, body, headers):
         body = self.fixtures.load('vm_create_from.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_reboot(self, method, url, body, headers):
+    def _xmlrpc__vm_reboot(self, method, url, body, headers):
         body = self.fixtures.load('vm_reboot.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_stop(self, method, url, body, headers):
+    def _xmlrpc__vm_stop(self, method, url, body, headers):
         body = self.fixtures.load('vm_stop.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__iface_list(self, method, url, body, headers):
+    def _xmlrpc__iface_list(self, method, url, body, headers):
         body = self.fixtures.load('iface_list.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__disk_list(self, method, url, body, headers):
+    def _xmlrpc__disk_list(self, method, url, body, headers):
         body = self.fixtures.load('disk_list.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_iface_attach(self, method, url, body, headers):
+    def _xmlrpc__vm_iface_attach(self, method, url, body, headers):
         body = self.fixtures.load('iface_attach.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_iface_detach(self, method, url, body, headers):
-            body = self.fixtures.load('iface_detach.xml')
-            return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    def _xmlrpc__vm_iface_detach(self, method, url, body, headers):
+        body = self.fixtures.load('iface_detach.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_disk_attach(self, method, url, body, headers):
+    def _xmlrpc__vm_disk_attach(self, method, url, body, headers):
         body = self.fixtures.load('disk_attach.xml')
         return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__vm_disk_detach(self, method, url, body, headers):
-            body = self.fixtures.load('disk_detach.xml')
-            return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    def _xmlrpc__vm_disk_detach(self, method, url, body, headers):
+        body = self.fixtures.load('disk_detach.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__disk_create_from(self, method, url, body, headers):
-            body = self.fixtures.load('disk_create_from.xml')
-            return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+    def _xmlrpc__disk_create(self, method, url, body, headers):
+        body = self.fixtures.load('disk_create.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__disk_create_from(self, method, url, body, headers):
+        body = self.fixtures.load('disk_create_from.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__disk_info(self, method, url, body, headers):
+        body = self.fixtures.load('disk_info.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
+
+    def _xmlrpc__disk_update(self, method, url, body, headers):
+        body = self.fixtures.load('disk_update.xml')
+        return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
-    def _xmlrpc_2_0__disk_update(self, method, url, body, headers):
-            body = self.fixtures.load('disk_update.xml')
+    def _xmlrpc__disk_delete(self, method, url, body, headers):
+            body = self.fixtures.load('disk_delete.xml')
             return (httplib.OK, body, {}, httplib.responses[httplib.OK])
 
 if __name__ == '__main__':



Mime
View raw message