incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962078 - /incubator/deltacloud/trunk/drivers/rhevm/lib/rhevm_driver.rb
Date Thu, 08 Jul 2010 23:21:25 GMT
Author: lutter
Date: Thu Jul  8 23:21:25 2010
New Revision: 962078

URL: http://svn.apache.org/viewvc?rev=962078&view=rev
Log:
Hook credentials up.

Modified:
    incubator/deltacloud/trunk/drivers/rhevm/lib/rhevm_driver.rb

Modified: incubator/deltacloud/trunk/drivers/rhevm/lib/rhevm_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/drivers/rhevm/lib/rhevm_driver.rb?rev=962078&r1=962077&r2=962078&view=diff
==============================================================================
--- incubator/deltacloud/trunk/drivers/rhevm/lib/rhevm_driver.rb (original)
+++ incubator/deltacloud/trunk/drivers/rhevm/lib/rhevm_driver.rb Thu Jul  8 23:21:25 2010
@@ -38,7 +38,10 @@ class RHEVMDriver < DeltaCloud::BaseDriv
   end
 
   def genArgString(credentials, args)
-    commonArgs = [SCRIPT_DIR_ARG, "vdcadmin", "123456", "demo"]
+    if ( credentials[:name].nil? || credentials[:password].nil? || credentials[:name] ==
'' || credentials[:password] == '' )
+      raise DeltaCloud::AuthException.new
+    end
+    commonArgs = [SCRIPT_DIR_ARG, credentials[:name], credentials[:password], "demo"]
     commonArgs.concat(args)
     commonArgs.join(" ")
   end
@@ -191,8 +194,8 @@ class RHEVMDriver < DeltaCloud::BaseDriv
 
   def create_instance(credentials, image_id, opts)
     name = opts[:name]
-    name ||= "New Instance"
-    vm = execute(credentials, "addVm.ps1", image_id, opts[:name], opts[:realm_id])
+    name = "NewInstance" if (name.nil? or name.empty?)
+    vm = execute(credentials, "addVm.ps1", image_id, name, opts[:realm_id])
     vm_to_instance(vm[0])
   end
 



Mime
View raw message