You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2010/07/09 01:33:17 UTC
svn commit: r962170 - in
/incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers:
ec2/ec2_driver.rb rackspace/rackspace_driver.rb
Author: lutter
Date: Thu Jul 8 23:33:16 2010
New Revision: 962170
URL: http://svn.apache.org/viewvc?rev=962170&view=rev
Log:
Cleanup whitespace
Remove trailing whitespace on lines and trailing blank lines
Modified:
incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/ec2/ec2_driver.rb
incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
Modified: incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/ec2/ec2_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/ec2/ec2_driver.rb?rev=962170&r1=962169&r2=962170&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/ec2/ec2_driver.rb (original)
+++ incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/ec2/ec2_driver.rb Thu Jul 8 23:33:16 2010
@@ -189,7 +189,7 @@ class EC2Driver < Deltacloud::BaseDriver
unless ( flavor_id )
image = image(credentials, :id=>image_id )
flavor = flavor( credentials, :architecture=>image.architecture )
- ( flavor_id = flavor.id ) if ( flavor )
+ ( flavor_id = flavor.id ) if ( flavor )
end
flavor_id.gsub!( /-/, '.' ) if flavor_id
ec2_instances = ec2.run_instances(
@@ -356,4 +356,3 @@ end
end
end
end
-
Modified: incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/rackspace/rackspace_driver.rb?rev=962170&r1=962169&r2=962170&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/rackspace/rackspace_driver.rb (original)
+++ incubator/deltacloud/trunk/server/libexec/lib/deltacloud/drivers/rackspace/rackspace_driver.rb Thu Jul 8 23:33:16 2010
@@ -32,7 +32,7 @@ class RackspaceDriver < Deltacloud::Base
:memory=>flav["ram"].to_f/1024,
:storage=>flav["disk"].to_i,
:architecture=>'x86_64'
- } )
+ } )
end
results = filter_on( results, :id, opts )
results = filter_on( results, :architecture, opts )
@@ -51,11 +51,11 @@ class RackspaceDriver < Deltacloud::Base
} )
end
results.sort_by{|e| [e.description]}
- results = filter_on( results, :id, opts )
+ results = filter_on( results, :id, opts )
results
end
- #rackspace does not at this stage have realms... its all US/TX, all the time (at least at time of writing)
+ #rackspace does not at this stage have realms... its all US/TX, all the time (at least at time of writing)
def realms(credentials, opts=nil)
[Realm.new( {
:id=>"us",
@@ -81,15 +81,15 @@ class RackspaceDriver < Deltacloud::Base
#
# create instance. Default to flavor 1 - really need a name though...
- # In rackspace, all flavors work with all images.
- #
+ # In rackspace, all flavors work with all images.
+ #
def create_instance(credentials, image_id, opts)
racks = new_client( credentials )
flavor_id = 1
if (opts[:flavor_id]) then flavor_id = opts[:flavor_id] end
name = Time.now.to_s
if (opts[:name]) then name = opts[:name] end
- convert_srv_to_instance(racks.start_server(image_id, flavor_id, name))
+ convert_srv_to_instance(racks.start_server(image_id, flavor_id, name))
end
#
@@ -99,10 +99,10 @@ class RackspaceDriver < Deltacloud::Base
racks = new_client(credentials)
instances = []
if (opts.nil?)
- instances = racks.list_servers.map do |srv|
+ instances = racks.list_servers.map do |srv|
convert_srv_to_instance(srv)
end
- else
+ else
instances << convert_srv_to_instance(racks.load_server_details(opts[:id]))
end
instances = filter_on( instances, :id, opts )
@@ -110,7 +110,7 @@ class RackspaceDriver < Deltacloud::Base
end
- def convert_srv_to_instance(srv)
+ def convert_srv_to_instance(srv)
Instance.new( {
:id=>srv["id"],
:state=>srv["status"] == "ACTIVE" ? "RUNNING" : "PENDING",
@@ -133,7 +133,7 @@ class RackspaceDriver < Deltacloud::Base
RackspaceClient.new(credentials[:name], credentials[:password])
end
- define_instance_states do
+ define_instance_states do
start.to( :pending ) .on( :create )
pending.to( :running ) .automatically