From 3485099f03d5384a83024faa4c8f279cdb0470ac Mon Sep 17 00:00:00 2001 From: Dinesh Bhoopathy Date: Fri, 3 Jan 2014 05:12:09 -0800 Subject: [PATCH] Issue LIBCLOUD-489: api end point change --- libcloud/common/hostvirtual.py | 2 +- libcloud/compute/drivers/hostvirtual.py | 2 +- libcloud/test/compute/test_hostvirtual.py | 24 +++++++++++------------ libcloud/test/dns/test_hostvirtual.py | 22 ++++++++++----------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/libcloud/common/hostvirtual.py b/libcloud/common/hostvirtual.py index 1c48308b98..402fa15fc6 100644 --- a/libcloud/common/hostvirtual.py +++ b/libcloud/common/hostvirtual.py @@ -22,7 +22,7 @@ from libcloud.compute.types import InvalidCredsError from libcloud.common.types import LibcloudError -API_HOST = 'www.vr.org' +API_HOST = 'vapi.vr.org' class HostVirtualException(LibcloudError): diff --git a/libcloud/compute/drivers/hostvirtual.py b/libcloud/compute/drivers/hostvirtual.py index 2d08815e67..b86425d243 100644 --- a/libcloud/compute/drivers/hostvirtual.py +++ b/libcloud/compute/drivers/hostvirtual.py @@ -33,7 +33,7 @@ from libcloud.compute.base import NodeImage, NodeSize, NodeLocation from libcloud.compute.base import NodeAuthSSHKey, NodeAuthPassword -API_ROOT = '/vapi' +API_ROOT = '' NODE_STATE_MAP = { 'BUILDING': NodeState.PENDING, diff --git a/libcloud/test/compute/test_hostvirtual.py b/libcloud/test/compute/test_hostvirtual.py index 9b90554b0d..257ada27b5 100644 --- a/libcloud/test/compute/test_hostvirtual.py +++ b/libcloud/test/compute/test_hostvirtual.py @@ -141,51 +141,51 @@ def test_create_node_in_location(self): class HostVirtualMockHttp(MockHttp): fixtures = ComputeFileFixtures('hostvirtual') - def _vapi_cloud_servers(self, method, url, body, headers): + def _cloud_servers(self, method, url, body, headers): body = self.fixtures.load('list_nodes.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_server(self, method, url, body, headers): + def _cloud_server(self, method, url, body, headers): body = self.fixtures.load('get_node.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_sizes(self, method, url, body, headers): + def _cloud_sizes(self, method, url, body, headers): body = self.fixtures.load('list_sizes.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_images(self, method, url, body, headers): + def _cloud_images(self, method, url, body, headers): body = self.fixtures.load('list_images.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_locations(self, method, url, body, headers): + def _cloud_locations(self, method, url, body, headers): body = self.fixtures.load('list_locations.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_cancel(self, method, url, body, headers): + def _cloud_cancel(self, method, url, body, headers): body = self.fixtures.load('node_destroy.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_server_reboot(self, method, url, body, headers): + def _cloud_server_reboot(self, method, url, body, headers): body = self.fixtures.load('node_reboot.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_server_shutdown(self, method, url, body, headers): + def _cloud_server_shutdown(self, method, url, body, headers): body = self.fixtures.load('node_stop.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_server_start(self, method, url, body, headers): + def _cloud_server_start(self, method, url, body, headers): body = self.fixtures.load('node_start.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_buy(self, method, url, body, headers): + def _cloud_buy(self, method, url, body, headers): body = self.fixtures.load('create_node.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_server_build(self, method, url, body, headers): + def _cloud_server_build(self, method, url, body, headers): body = self.fixtures.load('create_node.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_cloud_server_delete(self, method, url, body, headers): + def _cloud_server_delete(self, method, url, body, headers): body = self.fixtures.load('node_destroy.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) diff --git a/libcloud/test/dns/test_hostvirtual.py b/libcloud/test/dns/test_hostvirtual.py index 3ff404f870..ae304ca6a9 100644 --- a/libcloud/test/dns/test_hostvirtual.py +++ b/libcloud/test/dns/test_hostvirtual.py @@ -199,55 +199,55 @@ def test_delete_record_does_not_exist(self): class HostVirtualMockHttp(MockHttp): fixtures = DNSFileFixtures('hostvirtual') - def _vapi_dns_zone(self, method, url, body, headers): + def _dns_zone(self, method, url, body, headers): body = self.fixtures.load('get_zone.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_dns_zones(self, method, url, body, headers): + def _dns_zones(self, method, url, body, headers): body = self.fixtures.load('list_zones.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_dns_record(self, method, url, body, headers): + def _dns_record(self, method, url, body, headers): body = self.fixtures.load('get_record.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_dns_records(self, method, url, body, headers): + def _dns_records(self, method, url, body, headers): body = self.fixtures.load('list_records.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_dns_zone_ZONE_DOES_NOT_EXIST(self, method, url, body, headers): + def _dns_zone_ZONE_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('zone_does_not_exist.json') return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - def _vapi_dns_zone_RECORD_DOES_NOT_EXIST(self, method, url, body, headers): + def _dns_zone_RECORD_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('get_zone.json') return (httplib.OK, body, {}, httplib.responses[httplib.OK]) - def _vapi_dns_zones_ZONE_DOES_NOT_EXIST(self, method, url, body, headers): + def _dns_zones_ZONE_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('zone_does_not_exist.json') return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - def _vapi_dns_record_ZONE_DOES_NOT_EXIST(self, method, + def _dns_record_ZONE_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('zone_does_not_exist.json') return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - def _vapi_dns_record_RECORD_DOES_NOT_EXIST(self, method, + def _dns_record_RECORD_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('zone_does_not_exist.json') return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - def _vapi_dns_records_ZONE_DOES_NOT_EXIST(self, method, + def _dns_records_ZONE_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('zone_does_not_exist.json') return (httplib.NOT_FOUND, body, {}, httplib.responses[httplib.NOT_FOUND]) - def _vapi_dns_zones_RECORD_DOES_NOT_EXIST(self, method, + def _dns_zones_RECORD_DOES_NOT_EXIST(self, method, url, body, headers): body = self.fixtures.load('zone_does_not_exist.json') return (httplib.NOT_FOUND, body,