deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: Fix for DTACLOUD_306 - Openstack server ID should be passed as string
Date Fri, 24 Aug 2012 13:43:17 GMT
Updated Branches:
  refs/heads/master 71f746eba -> 698b0581b


Fix for DTACLOUD_306 - Openstack server ID should be passed as string

https://issues.apache.org/jira/browse/DTACLOUD-306


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/698b0581
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/698b0581
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/698b0581

Branch: refs/heads/master
Commit: 698b0581b243cf03497c94bbf33c0ffe39daf760
Parents: 71f746e
Author: marios <marios@redhat.com>
Authored: Thu Aug 23 19:19:39 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Fri Aug 24 16:42:18 2012 +0300

----------------------------------------------------------------------
 .../drivers/openstack/openstack_driver.rb          |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/698b0581/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
index b7b7c65..2f67a08 100644
--- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
+++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
@@ -119,7 +119,7 @@ module Deltacloud
           insts = []
           safely do
             if opts[:id]
-              server = os.get_server(opts[:id].to_i)
+              server = os.get_server(opts[:id])
               insts << convert_from_server(server, os.connection.authuser)
             else
               insts = os.list_servers_detail.collect do |server|
@@ -137,7 +137,7 @@ module Deltacloud
 #opts[:personality]: path1='server_path1'. content1='contents1', path2='server_path2', content2='contents2'
etc
           params = {}
           params[:personality] = extract_personality(opts)
-          params[:name] = (opts[:name] && opts[:name].length>0)? opts[:name] :
Time.now.to_s
+          params[:name] = (opts[:name] && opts[:name].length>0)? opts[:name] :
"server#{Time.now.to_s}"
           params[:imageRef] = image_id
           params[:flavorRef] =  (opts[:hwp_id] && opts[:hwp_id].length>0) ?
                           opts[:hwp_id] : hardware_profiles(credentials).first.name
@@ -157,7 +157,7 @@ module Deltacloud
         def reboot_instance(credentials, instance_id)
           os = new_client(credentials)
           safely do
-            server = os.get_server(instance_id.to_i)
+            server = os.get_server(instance_id)
             server.reboot! # sends a hard reboot (power cycle) - could instead server.reboot("SOFT")
             convert_from_server(server, os.connection.authuser)
           end
@@ -166,7 +166,7 @@ module Deltacloud
         def destroy_instance(credentials, instance_id)
           os = new_client(credentials)
           safely do
-            server = os.get_server(instance_id.to_i)
+            server = os.get_server(instance_id)
             server.delete!
             convert_from_server(server, os.connection.authuser)
           end


Mime
View raw message