Permalink
Browse files

Merge branch 'master' of https://github.com/auser/poolparty

Conflicts:
	Gemfile
	Gemfile.lock
  • Loading branch information...
2 parents 696906d + 18e708a commit 090702ff0ef20b555aa0ca8a1d6e77cbd373a20e @fairchild fairchild committed Sep 4, 2011
View
@@ -1,4 +1,6 @@
examples-private/
+.vagrant
+vendor/cache
/trash/
rdoc/*
.com.apple.timemachine.supported
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm use ruby-1.9.2@poolparty --create
View
20 Gemfile
@@ -1,16 +1,22 @@
source "http://rubygems.org"
+gemspec
+
+gem 'amazon-ec2', '~>0.9.17'
@fuentesjr

fuentesjr Sep 5, 2011

Contributor

Any reason why we have these here? I imagine we can simply add them to the gemspec file since the gemspec call here will include those dependencies.

+gem 'xml-simple'
+gem 'json'
gem 'git-style-binaries'
group :test do
- gem "shoulda"
- gem "mocha"
- gem "fakeweb"
- gem "right_http_connection"
- gem "mcmire-matchy"
+ gem 'fakeweb'
+ gem 'webmock'
+ gem 'shoulda'
+ gem 'rcov'
+ gem 'mocha'
+ gem 'right_http_connection'
+ gem "jnunemaker-matchy", "~> 0.4.0"
+ gem 'vagrant'
end
group :development do
gem "rdoc"
end
-
-gemspec
View
@@ -9,30 +9,61 @@ PATH
GEM
remote: http://rubygems.org/
specs:
+ addressable (2.2.6)
amazon-ec2 (0.9.17)
xml-simple (>= 1.0.12)
+ archive-tar-minitar (0.5.2)
+ crack (0.1.8)
+ erubis (2.7.0)
fakeweb (1.3.0)
+ ffi (1.0.9)
git-style-binaries (0.1.11)
shoulda
trollop
+ i18n (0.5.0)
+ jnunemaker-matchy (0.4.0)
json (1.5.3)
- mcmire-matchy (0.5.2)
mocha (0.9.12)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-ssh (2.1.4)
+ rcov (0.9.9)
rdoc (3.9.4)
right_http_connection (1.3.0)
shoulda (2.11.3)
+ thor (0.14.6)
trollop (1.16.2)
+ vagrant (0.8.6)
+ archive-tar-minitar (= 0.5.2)
+ erubis (~> 2.7.0)
+ i18n (~> 0.5.0)
+ json (~> 1.5.1)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.1.4)
+ thor (~> 0.14.6)
+ virtualbox (~> 0.9.1)
+ virtualbox (0.9.2)
+ ffi (~> 1.0.9)
+ webmock (1.6.4)
+ addressable (~> 2.2, > 2.2.5)
+ crack (>= 0.1.7)
xml-simple (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
+ amazon-ec2 (~> 0.9.17)
fakeweb
git-style-binaries
- mcmire-matchy
+ jnunemaker-matchy (~> 0.4.0)
+ json
mocha
poolparty!
+ rcov
rdoc
right_http_connection
shoulda
+ vagrant
+ webmock
+ xml-simple
View
@@ -1,8 +1,9 @@
+$:.unshift(File.join(File.dirname(__FILE__), "."))
require 'rake'
require "bundler/gem_tasks"
require 'rake/testtask'
-require 'rake/rdoctask'
-$: << File.dirname(__FILE__)
+require 'rdoc/task'
+
require 'config/requirements'
task :default => [:test, :cleanup_test]
@@ -27,12 +28,12 @@ end
# sh "ruby -Ilib:test #{Dir["#{File.dirname(__FILE__)}/../test/poolparty/*/*.rb"].join(" ")}"
# end
-Rake::TestTask.new(:test) do |t|
- t.test_files = FileList['test/lib/**/*_test.rb']
- t.warning = false
- t.verbose = false
+Rake::TestTask.new(:test) do |test|
+ test.libs << 'lib' << 'test'
+ test.pattern = 'test/**/*_test.rb'
+ test.verbose = true
end
-
+
begin
require 'rcov/rcovtask'
View
@@ -0,0 +1,86 @@
+Vagrant::Config.run do |config|
+ # All Vagrant configuration is done here. The most common configuration
+ # options are documented and commented below. For a complete reference,
+ # please see the online documentation at vagrantup.com.
+
+ # Every Vagrant virtual environment requires a box to build off of.
+ config.vm.box = "base"
+
+ # The url from where the 'config.vm.box' box will be fetched if it
+ # doesn't already exist on the user's system.
+ # config.vm.box_url = "http://domain.com/path/to/above.box"
+
+ # Boot with a GUI so you can see the screen. (Default is headless)
+ # config.vm.boot_mode = :gui
+
+ # Assign this VM to a host only network IP, allowing you to access it
+ # via the IP.
+ config.vm.network "33.33.33.10"
+
+ # Forward a port from the guest to the host, which allows for outside
+ # computers to access the VM, whereas host only networking does not.
+ # config.vm.forward_port "http", 80, 8080
+
+ # Share an additional folder to the guest VM. The first argument is
+ # an identifier, the second is the path on the guest to mount the
+ # folder, and the third is the path on the host to the actual folder.
+ config.vm.share_folder "v-data", "/vagrant_data", ".", :nfs => true
+
+ # Enable provisioning with Puppet stand alone. Puppet manifests
+ # are contained in a directory path relative to this Vagrantfile.
+ # You will need to create the manifests directory and a manifest in
+ # the file base.pp in the manifests_path directory.
+ #
+ # An example Puppet manifest to provision the message of the day:
+ #
+ # # group { "puppet":
+ # # ensure => "present",
+ # # }
+ # #
+ # # File { owner => 0, group => 0, mode => 0644 }
+ # #
+ # # file { '/etc/motd':
+ # # content => "Welcome to your Vagrant-built virtual machine!
+ # # Managed by Puppet.\n"
+ # # }
+ #
+ # config.vm.provision :puppet do |puppet|
+ # puppet.manifests_path = "manifests"
+ # puppet.manifest_file = "base.pp"
+ # end
+
+ # Enable provisioning with chef solo, specifying a cookbooks path (relative
+ # to this Vagrantfile), and adding some recipes and/or roles.
+ #
+ # config.vm.provision :chef_solo do |chef|
+ # chef.cookbooks_path = "cookbooks"
+ # chef.add_recipe "mysql"
+ # chef.add_role "web"
+ #
+ # # You may also specify custom JSON attributes:
+ # chef.json = { :mysql_password => "foo" }
+ # end
+
+ # Enable provisioning with chef server, specifying the chef server URL,
+ # and the path to the validation key (relative to this Vagrantfile).
+ #
+ # The Opscode Platform uses HTTPS. Substitute your organization for
+ # ORGNAME in the URL and validation key.
+ #
+ # If you have your own Chef Server, use the appropriate URL, which may be
+ # HTTP instead of HTTPS depending on your configuration. Also change the
+ # validation key to validation.pem.
+ #
+ # config.vm.provision :chef_client do |chef|
+ # chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
+ # chef.validation_key_path = "ORGNAME-validator.pem"
+ # end
+ #
+ # If you're using the Opscode platform, your validator client is
+ # ORGNAME-validator, replacing ORGNAME with your organization name.
+ #
+ # IF you have your own Chef Server, the default validation client name is
+ # chef-validator, unless you changed the configuration.
+ #
+ # chef.validation_client_name = "ORGNAME-validator"
+end
@@ -2,17 +2,6 @@
EC2 CloudProvider
This serves as the basis for running PoolParty on Amazon's ec2 cloud.
=end
-begin
- require 'AWS'
-rescue LoadError
- puts <<-EOM
- There was an error requiring AWS
-EOM
-end
-
-require 'pp'
-
-POOLPARTY_CONFIG_FILE = "#{ENV["HOME"]}/.poolparty/aws" unless defined?(POOLPARTY_CONFIG_FILE)
module CloudProviders
class Ec2 < CloudProvider
View
@@ -2,11 +2,23 @@
t=Time.now
+require 'yaml'
+
# Load system gems
-%w(rubygems logger erb open-uri yaml).each do |lib|
+%w(rubygems logger erb open-uri fileutils).each do |lib|
require lib
end
+begin
+ require 'AWS'
+rescue LoadError
+ puts <<-EOM
+ There was an error requiring AWS
+EOM
+end
+
+require 'pp'
+
# Add all vendor gems to the load paths
Dir[File.dirname(__FILE__)+"/../vendor/gems/*"].each {|lib| $LOAD_PATH.unshift(File.expand_path("#{lib}/lib")) }
@@ -41,6 +53,8 @@ def self.lib_dir
require "keypair"
+POOLPARTY_CONFIG_FILE = "#{ENV["HOME"]}/.poolparty/aws" unless defined?(POOLPARTY_CONFIG_FILE)
+
# PoolParty core
$LOAD_PATH.unshift(File.dirname(__FILE__)/"poolparty")
%w( base
@@ -1,7 +1,7 @@
pool :tssh do
cloud :tgarden do
instances 2
- keypair fixtures_dir/'keys/test_key'
+ keypair File.join(FIXTURES_PATH, 'keys/test_key')
using :ssh do
user 'fairchild' #default is root
hosts %w(beet squash)
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../test_helper"
+require "test_helper"
class ArrayTest < Test::Unit::TestCase
def setup
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../test_helper"
+require 'test_helper'
class HashTest < Test::Unit::TestCase
context "Hash" do
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../test_helper"
+require 'test_helper'
class ObjectTest < Test::Unit::TestCase
context "object" do
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../test_helper"
+require 'test_helper'
class StringTest < Test::Unit::TestCase
context "string" do
@@ -1,4 +1,4 @@
-require "#{File.dirname(__FILE__)}/../../test_helper"
+require 'test_helper'
class SymbolTest < Test::Unit::TestCase
context "Symbol" do
@@ -1,14 +1,14 @@
-require "#{File.dirname(__FILE__)}/../../test_helper"
+require 'test_helper'
# require 'rr'
-stub_ec2_calls
class CloudTest < Test::Unit::TestCase
# include RR::Adapters::TestUnit
def setup
clear!
- @filepath = fixtures_dir/"clouds/simple_cloud.rb"
+ @filepath = File.join(FIXTURES_PATH, "clouds/simple_cloud.rb")
require @filepath
@cloud = pool.clouds[pool.clouds.keys.first]
+ stub_ec2_calls
end
def test_have_a_pool_name
@@ -33,7 +33,7 @@ def test_set_the_cloud_provider_cloud_and_keypair_with_cloud_provider
def test_set_the_cloud_provider_with_a_using_block
@cloud.instance_eval do
using :ec2
- keypair "test_key", fixtures_dir/"keys"
+ keypair "test_key", File.join(FIXTURES_PATH, "keys")
image_id 'emi-39921602'
end
assert_equal :ec2, @cloud.cloud_provider.name
@@ -44,7 +44,7 @@ def test_set_the_cloud_provider_with_a_using_block
def test_nodes
assert_respond_to @cloud, :nodes
assert_respond_to @cloud.nodes, :each
- assert @cloud.nodes.size>1
+ assert @cloud.nodes.size>1, "Cloudsize was: #{@cloud.nodes.size}"
end
def test_run
Oops, something went wrong.

0 comments on commit 090702f

Please sign in to comment.