auser-poolparty 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/VERSION.yml +1 -1
  2. data/bin/cloud-list +4 -4
  3. data/bin/cloud-provision +2 -0
  4. data/bin/cloud-ssh +1 -1
  5. data/bin/install-poolparty +1 -1
  6. data/examples/fairchild.rb +26 -17
  7. data/examples/metavirt_cloud.rb +2 -4
  8. data/lib/poolparty.rb +2 -7
  9. data/lib/poolparty/core/array.rb +1 -1
  10. data/lib/poolparty/core/exception.rb +1 -1
  11. data/lib/poolparty/core/hash.rb +12 -5
  12. data/lib/poolparty/core/integer.rb +11 -0
  13. data/lib/poolparty/core/object.rb +14 -0
  14. data/lib/poolparty/core/string.rb +6 -1
  15. data/lib/poolparty/core/time.rb +6 -0
  16. data/lib/poolparty/extra/duration.rb +96 -0
  17. data/lib/poolparty/helpers/binary.rb +1 -1
  18. data/lib/poolparty/modules/cloud_resourcer.rb +1 -1
  19. data/lib/poolparty/modules/definable_resource.rb +5 -7
  20. data/lib/poolparty/modules/output.rb +2 -2
  21. data/lib/poolparty/monitors/base_monitor.rb +17 -0
  22. data/lib/poolparty/net/init.rb +4 -11
  23. data/lib/poolparty/net/remote_instance.rb +5 -0
  24. data/lib/poolparty/net/remoter/connections.rb +14 -11
  25. data/lib/poolparty/net/remoter/interactive.rb +13 -2
  26. data/lib/poolparty/net/remoter_base.rb +9 -4
  27. data/lib/poolparty/net/remoter_bases/ec2/ec2.rb +50 -35
  28. data/lib/poolparty/net/remoter_bases/ec2/ec2_remote_instance.rb +46 -5
  29. data/lib/poolparty/net/remoter_bases/ec2/ec2_response_object.rb +57 -1
  30. data/lib/poolparty/plugins/apache2/apache.rb +13 -160
  31. data/lib/poolparty/plugins/apache2/passenger_site.rb +86 -0
  32. data/lib/poolparty/plugins/apache2/php5.rb +40 -0
  33. data/lib/poolparty/plugins/apache2/virtual_host.rb +53 -0
  34. data/lib/poolparty/plugins/authorized_key.rb +2 -2
  35. data/lib/poolparty/plugins/bind.rb +5 -6
  36. data/lib/poolparty/plugins/{chef.rb → chef/chef.rb} +22 -18
  37. data/lib/poolparty/plugins/{chef_deploy.rb → chef/chef_deploy.rb} +20 -19
  38. data/lib/poolparty/plugins/deploy_directory.rb +2 -3
  39. data/lib/poolparty/plugins/gem_package.rb +6 -12
  40. data/lib/poolparty/plugins/git.rb +22 -7
  41. data/lib/poolparty/{base_packages → plugins}/haproxy.rb +2 -2
  42. data/lib/poolparty/{base_packages → plugins}/heartbeat.rb +7 -7
  43. data/lib/poolparty/plugins/line_in_file.rb +4 -2
  44. data/lib/poolparty/plugins/plugin_template.rb +13 -0
  45. data/lib/poolparty/{base_packages/poolparty.rb → plugins/poolparty_base_packages.rb} +2 -2
  46. data/lib/poolparty/plugins/rails_deploy.rb +2 -3
  47. data/lib/poolparty/{base_packages → plugins}/ruby.rb +3 -3
  48. data/lib/poolparty/{base_packages → plugins}/runit.rb +3 -3
  49. data/lib/poolparty/plugins/svn.rb +8 -6
  50. data/lib/poolparty/poolparty/cloud.rb +5 -8
  51. data/lib/poolparty/poolparty/default.rb +1 -1
  52. data/lib/poolparty/poolparty/plugin.rb +36 -15
  53. data/lib/poolparty/poolparty/pool.rb +6 -2
  54. data/lib/poolparty/poolparty/poolparty_base_class.rb +5 -11
  55. data/lib/poolparty/poolparty/resource.rb +2 -1
  56. data/lib/poolparty/poolparty/service.rb +6 -8
  57. data/lib/poolparty/provision/dr_configure.rb +3 -3
  58. data/lib/poolparty/verification/verifier_base.rb +10 -0
  59. data/spec/bin/server-list-active_spec.rb +1 -3
  60. data/spec/poolparty/core/string_spec.rb +1 -1
  61. data/spec/poolparty/dependency_resolver/chef_resolver_spec.rb +0 -2
  62. data/spec/poolparty/dependency_resolver/dependency_resolver_cloud_extensions_spec.rb +16 -13
  63. data/spec/poolparty/extra/deployments_spec.rb +68 -68
  64. data/spec/poolparty/net/remoter_bases/ec2_spec.rb +1 -0
  65. data/spec/poolparty/plugins/deploydirectory_spec.rb +64 -51
  66. data/spec/poolparty/poolparty/cloud_spec.rb +21 -19
  67. data/spec/poolparty/poolparty/configurers/files/ruby_basic.rb +1 -1
  68. data/spec/poolparty/poolparty/configurers/files/ruby_plugins.rb +1 -1
  69. data/spec/poolparty/{base_packages → poolparty}/haproxy_spec.rb +1 -1
  70. data/spec/poolparty/{base_packages → poolparty}/heartbeat_spec.rb +1 -1
  71. data/spec/poolparty/poolparty/plugin_model_spec.rb +6 -13
  72. data/spec/poolparty/poolparty/plugin_spec.rb +7 -7
  73. data/spec/poolparty/poolparty/resource_spec.rb +15 -5
  74. data/spec/poolparty/poolparty/test_plugins/webserver.rb +27 -23
  75. data/test/fixtures/metavirt_cloud.json +1 -0
  76. data/test/poolparty/dependency_resolver/puppet_resolver_test.rb +0 -5
  77. data/test/poolparty/modules/cloud_dsl_test.rb +1 -1
  78. data/test/poolparty/monitors/test_base_monitor.rb +17 -0
  79. data/test/poolparty/monitors/test_monitor_rack.rb +39 -0
  80. data/test/poolparty/net/remoter_base_test.rb +18 -0
  81. data/test/poolparty/plugins/chef_deploy_test.rb +1 -1
  82. data/test/poolparty/plugins/rails_deploy_test.rb +3 -3
  83. data/test/poolparty/poolparty/cloud_test.rb +27 -2
  84. data/test/poolparty/poolparty/isolated_cloud_test.rb +25 -0
  85. data/test/poolparty/poolparty/plugin_test.rb +9 -8
  86. data/test/poolparty/poolparty/schema_test.rb +13 -0
  87. data/test/poolparty/verification/verify_test.rb +4 -0
  88. data/test/test_helper.rb +10 -3
  89. data/test/test_methods.rb +11 -0
  90. data/vendor/gems/dslify/test/dslify_test.rb +28 -0
  91. metadata +29 -15
  92. data/lib/poolparty/extra/deployments.rb +0 -31
  93. data/lib/poolparty/poolparty/plugin_model.rb +0 -46
@@ -2,8 +2,8 @@
2
2
  Enables haproxy for a cloud
3
3
  =end
4
4
  module PoolParty
5
- class Base
6
- plugin :haproxy do
5
+ module Plugin
6
+ class Haproxy < Plugin
7
7
 
8
8
  default_options(
9
9
  :port => 80,
@@ -1,16 +1,16 @@
1
1
  module PoolParty
2
- class Base
3
- plugin :poolparty_base_heartbeat do
2
+ module Plugin
3
+ class Heartbeat < Plugin
4
4
 
5
- def enable
6
-
5
+ def enable
6
+
7
7
  has_package({:name => "heartbeat-2"})
8
8
  has_package({:name => "heartbeat-2-dev"})
9
9
 
10
10
  has_service("heartbeat")
11
-
11
+
12
12
  end
13
-
14
- end
13
+
14
+ end
15
15
  end
16
16
  end
@@ -15,19 +15,21 @@ Ensures that the line given is in the file
15
15
  has_line_in_file("ENABLED=1", "/etc/default/haproxy")
16
16
  =end
17
17
 
18
- class LineInFile
18
+ module Plugin
19
+ class LineInFile < Plugin
19
20
 
20
- plugin :line_in_file do
21
21
  dsl_methods :file, :line
22
22
  default_options(
23
23
  :line => ""
24
24
  )
25
+
25
26
  def loaded(opts={}, &block)
26
27
  has_exec "line_in_#{file}" do
27
28
  command "grep -q \'#{line.safe_quote}\' #{file} || echo \'#{line.safe_quote}\' >> #{file}"
28
29
  not_if "grep -q \'#{line.safe_quote}\' #{file}"
29
30
  end
30
31
  end
32
+
31
33
  end
32
34
 
33
35
  end
@@ -0,0 +1,13 @@
1
+ module PoolParty
2
+ module Plugin
3
+ # Usage:
4
+ #
5
+ # plugin_name :optional=>'option if any' do
6
+ # extras :cli, :pspell, :mysql
7
+ # end
8
+
9
+ class EmptyPlugin < Plugin
10
+ end
11
+ end
12
+
13
+ end
@@ -1,6 +1,6 @@
1
1
  module PoolParty
2
- class Base
3
- plugin :poolparty_base_packages do
2
+ module Plugin
3
+ class PoolPartyBasePackages < Plugin
4
4
 
5
5
  def enable
6
6
  has_cron "/usr/bin/server-manage-election" do
@@ -13,9 +13,8 @@
13
13
  chef-deploy to deploy the application
14
14
  =end
15
15
  module PoolParty
16
- class Rails
17
-
18
- plugin :rails_deploy do
16
+ module Plugin
17
+ class RailsDeploy< Plugin
19
18
 
20
19
  dsl_methods :shared, :database_yml, :repo, :user, :user_dir
21
20
 
@@ -1,6 +1,6 @@
1
1
  module PoolParty
2
- class Base
3
- plugin :poolparty_base_ruby do
2
+ module Plugin
3
+ class Ruby < Plugin
4
4
 
5
5
  def enable
6
6
  install_base_packages
@@ -8,7 +8,7 @@ module PoolParty
8
8
 
9
9
  def install_base_packages
10
10
  has_package(:name => "libreadline-ruby1.8")
11
- has_package(:name => "libruby1.8")
11
+ has_package(:name => "libruby1.8")
12
12
  has_package(:name => "ruby1.8-dev")
13
13
  has_package(:name => "ruby1.8")
14
14
 
@@ -3,8 +3,8 @@
3
3
  NOT IMPLEMENTED YET
4
4
  =end
5
5
  module PoolParty
6
- class Base
7
- plugin :poolparty_base_runit do
6
+ module Plugin
7
+ class PoolPartyBaseRunit < Plugin
8
8
 
9
9
  def enable
10
10
  unless enabled
@@ -13,7 +13,7 @@ module PoolParty
13
13
  has_exec(:name => "/sbin/start runsvdir", :cwd => "/var/service")
14
14
  # has_remotefile(:name => "/etc/event.d/runsvdir", :notify => get_exec("/sbin/start runsvdir"))
15
15
  enabled true
16
- end
16
+ end
17
17
  end
18
18
 
19
19
  end
@@ -1,13 +1,15 @@
1
- module PoolParty
2
- class SvnResource
3
-
4
- virtual_resource :svn do
1
+ module PoolParty
2
+ module Plugin
3
+
4
+ class Svn < Plugin
5
+
5
6
  def loaded(*args)
6
7
  has_package :name => "subversion"
7
8
  end
9
+
8
10
  end
9
11
 
10
- virtual_resource :svn_repos do
12
+ class SvnRepos < Plugin
11
13
 
12
14
  dsl_methods :creates, :command, :cwd, :source, :working_dir, :at
13
15
 
@@ -15,7 +17,7 @@ module PoolParty
15
17
  has_package("subversion")
16
18
  has_svn_repository
17
19
  end
18
-
20
+
19
21
  def has_svn_repository
20
22
  has_directory(::File.dirname(working_dir))
21
23
  has_directory(:name => "#{working_dir}", :requires => get_directory("#{::File.dirname(working_dir)}"))
@@ -1,4 +1,3 @@
1
- require File.dirname(__FILE__) + "/plugin_model"
2
1
  require File.dirname(__FILE__) + "/resource"
3
2
 
4
3
  module PoolParty
@@ -42,14 +41,13 @@ module PoolParty
42
41
  )
43
42
 
44
43
  include CloudResourcer
45
- include PoolParty::PluginModel
46
44
  include PoolParty::Resources
47
45
  include PoolParty::Callbacks
48
46
  include PoolParty::DependencyResolverCloudExtensions
49
47
  include PrettyPrinter
50
48
 
51
49
  # Net methods
52
- include ::PoolParty::Remote
50
+ include PoolParty::Remote
53
51
  include PoolParty::CloudDsl
54
52
  include PoolParty::Verification
55
53
  # include PoolParty::Monitors
@@ -95,7 +93,7 @@ module PoolParty
95
93
 
96
94
  setup_callbacks
97
95
 
98
- plugin_directory "#{pool_specfile ? ::File.dirname(pool_specfile) : Dir.pwd}/plugins"
96
+ plugin_directory "#{pool_specfile ? ::File.dirname(pool_specfile) : Dir.pwd}/plugins"
99
97
  before_create
100
98
  super
101
99
  after_create
@@ -277,7 +275,6 @@ module PoolParty
277
275
  def to_hash
278
276
  hsh = to_properties_hash
279
277
  hsh[:options].merge!({:remote_base => remote_base.to_hash})
280
- # hsh.reject{|k,v| k == :remote_base || k == :cloud}
281
278
  hsh
282
279
  end
283
280
 
@@ -378,15 +375,15 @@ module PoolParty
378
375
  end
379
376
 
380
377
  # Add all the poolparty requirements here
381
- # NOTE: These are written as plugins in the lib/poolparty/base_packages directory
378
+ # NOTE: These are written as plugins in the lib/poolparty/plugins directory
382
379
  # for examples.
383
380
  # Also note that there is no block associated. This is because we have written
384
381
  # all that is necessary in a method called enable
385
382
  # which is called when there is no block
386
383
  def add_poolparty_base_requirements
387
384
  # poolparty_base_heartbeat
388
- poolparty_base_ruby
389
- poolparty_base_packages
385
+ ruby
386
+ pool_party_base_packages
390
387
  end
391
388
 
392
389
  end
@@ -3,7 +3,7 @@
3
3
  This handles user interaction, loading the parameters, etc.
4
4
  =end
5
5
  require "open-uri"
6
- require "ftools"
6
+ require "fileutils"
7
7
  module PoolParty
8
8
  class Default
9
9
  include Dslify
@@ -3,36 +3,34 @@ require "#{::File.dirname(__FILE__)}/../provision/boot_strapper.rb"
3
3
 
4
4
  module PoolParty
5
5
  module Plugin
6
+
7
+ def self.available
8
+ @available_plugins ||= []
9
+ end
6
10
 
7
11
  class Plugin < PoolParty::Service
8
12
  include CloudResourcer
9
13
  include PoolParty::DependencyResolverCloudExtensions
10
14
  include PoolParty::Callbacks
11
15
 
12
- default_options(
13
- :name => nil
14
- )
16
+ dsl_methods :name
15
17
 
16
- def initialize(opts={}, extra_opts={}, prnt=nil, &block)
18
+ def initialize(opts={}, extra_opts={}, prnt=nil, &block)
17
19
  setup_callbacks
18
20
 
19
- run_in_context do
20
- before_load(opts, &block)
21
- end
21
+ run_in_context { before_load(opts, &block) }
22
22
 
23
- block = Proc.new {enable} unless block
23
+ block = Proc.new {enable} unless block
24
24
 
25
25
  super(opts, &block)
26
26
 
27
- run_in_context do
28
- loaded opts, &block
29
- end
27
+ run_in_context { loaded opts, &block }
30
28
 
31
29
  after_create
32
30
  end
33
31
 
34
32
  # Overwrite this method
35
- def before_load(o={}, &block)
33
+ def before_load(o={}, &block)
36
34
  end
37
35
  def loaded(o={}, &block)
38
36
  end
@@ -70,9 +68,32 @@ module PoolParty
70
68
  end
71
69
 
72
70
  def self.inherited(subclass)
73
- method_name = subclass.to_s.top_level_class.gsub(/pool_party_/, '').gsub(/_class/, '').downcase.to_sym
74
- add_has_and_does_not_have_methods_for(method_name)
75
- add_resource_lookup_method(method_name)
71
+
72
+ klass = subclass.to_s.split('::').pop.to_s
73
+ add_has_and_does_not_have_methods_for(klass.snake_case)
74
+ add_resource_lookup_method(klass.snake_case)
75
+
76
+ # Add the plugin definition to the cloud as an instance method
77
+ # For example apache do; apache option and method; end
78
+ meth = <<-EOM
79
+ def #{klass.snake_case}(opts={}, &block)
80
+ i = plugin_store.select {|i| i if i.class.to_s =~ /#{klass}/ }.first if plugin_store
81
+ if i
82
+ i
83
+ else
84
+ inst = ::PoolParty::Plugin::#{klass}.new(opts, parent, &block)
85
+ plugin_store << inst if plugin_store
86
+ inst
87
+ end
88
+ end
89
+ EOM
90
+
91
+ ::PoolParty::PoolPartyBaseClass.module_eval meth
92
+
93
+ # Store the plugins so they will be availble in an array at Plugin.available
94
+ ::PoolParty::Plugin.available << subclass
95
+ super
96
+
76
97
  end
77
98
 
78
99
  end
@@ -44,8 +44,13 @@ module PoolParty
44
44
  super(&block)
45
45
  end
46
46
 
47
+
47
48
  def self.load_from_file(filename=nil)
48
49
  # a = new ::File.basename(filename, ::File.extname(filename))
50
+ #TODO: load any user defined monitors plugins verifiers before the cloud spec is evaled
51
+ #%w(monitors plugins verifiers).each do |lib|
52
+ # Dir[File.join(::File.dirname(::File.basename(filename)), lib, '*')].each{|f| require f }
53
+ # end
49
54
  File.open(filename, 'r') do |f|
50
55
  instance_eval f.read, pool_specfile
51
56
  end
@@ -58,8 +63,7 @@ module PoolParty
58
63
 
59
64
  def parent;nil;end
60
65
 
61
- def setup_defaults
62
- PoolParty::Extra::Deployments.include_deployments "#{Dir.pwd}/deployments"
66
+ def setup_defaults
63
67
  end
64
68
 
65
69
  def pool_clouds
@@ -13,7 +13,7 @@ module PoolParty
13
13
  $context_stack ||= []
14
14
  end
15
15
 
16
- class PoolPartyBaseClass
16
+ class PoolPartyBaseClass
17
17
  attr_reader :init_opts
18
18
 
19
19
  include Parenting, Dslify
@@ -72,16 +72,10 @@ module PoolParty
72
72
  end
73
73
 
74
74
  # Add to the services pool for the manifest listing
75
- def add_service(serv, extra_name="")
76
- subclass = "#{serv.class.to_s.top_level_class.underscore.downcase}#{extra_name}"
77
- lowercase_class_name = subclass.to_s.underscore.downcase || subclass.downcase
78
-
79
- # (services[lowercase_class_name.to_sym] ||= []) << serv if serv && !serv.empty?
75
+ def add_service(serv)
80
76
  ordered_resources << serv
81
- # services.merge!({lowercase_class_name.to_sym => serv})
82
77
  end
83
- # Container for the services
84
-
78
+
85
79
  def inspect
86
80
  to_properties_hash.inspect
87
81
  end
@@ -92,7 +86,6 @@ module PoolParty
92
86
 
93
87
  def to_json
94
88
  to_hash.to_json
95
- # JSON.generate(to_hash)
96
89
  end
97
90
 
98
91
  def resources
@@ -120,7 +113,8 @@ module PoolParty
120
113
  opts = (opts.is_a?(Hash) ? extra_opts.merge(opts) : extra_opts).merge(:name => temp_name)
121
114
 
122
115
  # opts.merge!(:name => temp_name) unless opts.has_key?(:name)
123
- res = if PoolParty::Resources::Resource.available_resources.include?(ty.to_s.camelize)
116
+ res = if (PoolParty::Resources::Resource.available_resources.include?(ty.to_s.camelize) ||
117
+ PoolParty::Resources::Resource.available_resources.include?("PoolParty::Resources::#{ty.to_s.camelize}".camelize.constantize))
124
118
  "PoolParty::Resources::#{ty.to_s.camelize}".camelize.constantize.new(opts, &block)
125
119
  else
126
120
  "#{ty.to_s.camelize}".camelize.constantize.new(opts.merge(:name), &block)
@@ -37,6 +37,7 @@ module PoolParty
37
37
  # those methods. Then we make sure we add these resources as available_resources
38
38
  # onto the class so we know it's available as a resource
39
39
  def self.inherited(subclass)
40
+ original_subclass = subclass
40
41
  subclass = subclass.to_s.split("::")[-1] if subclass.to_s.index("::")
41
42
  lowercase_class_name = subclass.to_s.underscore.downcase || subclass.downcase
42
43
  method_name = "__#{lowercase_class_name}".to_sym
@@ -59,7 +60,7 @@ module PoolParty
59
60
  PoolParty::PoolPartyBaseClass.add_has_and_does_not_have_methods_for(lowercase_class_name.to_sym)
60
61
  PoolParty::PoolPartyBaseClass.add_resource_lookup_method(lowercase_class_name)
61
62
 
62
- available_resources << subclass
63
+ available_resources << original_subclass
63
64
  end
64
65
  end
65
66
 
@@ -6,7 +6,7 @@ module PoolParty
6
6
 
7
7
  def to_properties_hash
8
8
  { :pp_type => "plugin", :options => dsl_options,
9
- :name => self.class.to_s.top_level_class,
9
+ :name => (dsl_options[:name] ? dsl_options[:name] : self.class.to_s.split('::').pop.snake_case),
10
10
  :resources => ordered_resources.map {|a| a.to_properties_hash }}
11
11
  end
12
12
 
@@ -17,20 +17,18 @@ module PoolParty
17
17
  nil
18
18
  end
19
19
 
20
- def self.add_has_and_does_not_have_methods_for(typ=:file)
21
- lowercase_class_name = typ.to_s.top_level_class.downcase
22
-
20
+ def self.add_has_and_does_not_have_methods_for(typ=:file)
23
21
  meth = <<-EOM
24
- def __#{lowercase_class_name}(opts={}, &block)
25
- i = PoolParty::#{lowercase_class_name.camelcase}Class.new(opts, &block)
22
+ def __#{typ}(opts={}, &block)
23
+ i = ::PoolParty::Plugin::#{typ.camelcase}.new(opts, &block)
26
24
  plugin_store << i if respond_to?(:plugin_store)
27
25
  i
28
26
  end
29
- alias :#{lowercase_class_name} :__#{lowercase_class_name}
27
+ alias :#{typ} :__#{typ}
30
28
  EOM
31
29
 
32
30
  PoolParty::PoolPartyBaseClass.module_eval meth
33
- PoolParty::PoolPartyBaseClass.add_has_and_does_not_have_methods_for(lowercase_class_name.to_sym)
31
+ PoolParty::PoolPartyBaseClass.add_has_and_does_not_have_methods_for(typ.to_sym)
34
32
  end
35
33
 
36
34
  end
@@ -52,7 +52,7 @@ module PoolParty
52
52
 
53
53
  def prescribe_configuration
54
54
  ::FileUtils.mkdir_p "#{cloud.tmp_path}/dr_configure" unless ::File.directory?("#{cloud.tmp_path}/dr_configure")
55
- ::File.cp $pool_specfile, "#{cloud.tmp_path}/dr_configure/clouds.rb"
55
+ ::FileUtils.cp $pool_specfile, "#{cloud.tmp_path}/dr_configure/clouds.rb"
56
56
  ::File.open "#{cloud.tmp_path}/dr_configure/clouds.json", "w" do |f|
57
57
  f << cloud.to_json
58
58
  end
@@ -99,7 +99,7 @@ module PoolParty
99
99
  'chmod 644 /var/poolparty/dr_configure/clouds.rb',
100
100
  'cp /var/poolparty/dr_configure/clouds.json /etc/poolparty',
101
101
  'cp /var/poolparty/dr_configure/clouds.rb /etc/poolparty',
102
- 'server-manage-election', #ensures that the monitor gets some data
102
+ # 'server-manage-election', #ensures that the monitor gets some data
103
103
  'echo "configure" >> /var/poolparty/POOLPARTY.PROGRESS'
104
104
  ]
105
105
  commands << self.class.class_commands unless self.class.class_commands.empty?
@@ -131,7 +131,7 @@ module PoolParty
131
131
  # cookie = (1..16).collect { chars[rand(chars.size)] }.pack("C*")
132
132
  cookie = (1..65).collect {rand(9)}.join()
133
133
  cookie_file = ::File.open("#{cloud.tmp_path}/dr_configure/erlang.cookie", 'w+'){|f| f << cookie }
134
- ::File.cp "#{::File.dirname(__FILE__)}/../templates/erlang_cookie_maker", "#{cloud.tmp_path}/dr_configure/"
134
+ ::FileUtils.cp "#{::File.dirname(__FILE__)}/../templates/erlang_cookie_maker", "#{cloud.tmp_path}/dr_configure/"
135
135
  end
136
136
 
137
137
  def self.class_commands