You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/01/02 15:41:10 UTC
[1/4] git commit: VSphere: Make API_PROVIDER format consistent with
other drivers (DTACLOUD-399)
VSphere: Make API_PROVIDER format consistent with other drivers (DTACLOUD-399)
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/8786328f
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/8786328f
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/8786328f
Branch: refs/heads/master
Commit: 8786328fd16ebd43e59509c0ec572a5646d04159
Parents: 4662285
Author: Michal Fojtik <mf...@redhat.com>
Authored: Wed Jan 2 14:49:01 2013 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Wed Jan 2 14:49:01 2013 +0100
----------------------------------------------------------------------
.../deltacloud/drivers/vsphere/vsphere_driver.rb | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/8786328f/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 11d2759..4f9df5f 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -409,7 +409,14 @@ module Deltacloud::Drivers::Vsphere
end
def host_endpoint
- endpoint = api_provider
+ endpoint = "#{api_provider}"
+ # We need to have the 'hostname' form in API_PROVIDER, but to be
+ # compatible with other drivers, we allow 'https://vsphere/api' format.
+ # The 'http' and '/.*' parts are however stripped.
+ if endpoint =~ /^http/
+ endpoint.gsub!(/^http(s?):\/\//, '')
+ endpoint.gsub!(/\/.*$/, '')
+ end
endpoint || Deltacloud::Drivers::driver_config[:vsphere][:entrypoints]['default']['default']
end