solutious-rudy 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/CHANGES.txt +8 -1
  2. data/bin/rudy +4 -0
  3. data/bin/rudy-ec2 +1 -0
  4. data/lib/rudy.rb +1 -1
  5. data/lib/rudy/aws/ec2.rb +4 -5
  6. data/lib/rudy/aws/ec2/group.rb +0 -2
  7. data/lib/rudy/aws/sdb.rb +3 -3
  8. data/lib/rudy/cli/aws/ec2/addresses.rb +5 -5
  9. data/lib/rudy/cli/aws/ec2/candy.rb +16 -16
  10. data/lib/rudy/cli/aws/ec2/groups.rb +6 -6
  11. data/lib/rudy/cli/aws/ec2/images.rb +3 -3
  12. data/lib/rudy/cli/aws/ec2/info.rb +18 -18
  13. data/lib/rudy/cli/aws/ec2/instances.rb +15 -15
  14. data/lib/rudy/cli/aws/ec2/keypairs.rb +6 -6
  15. data/lib/rudy/cli/aws/ec2/snapshots.rb +1 -1
  16. data/lib/rudy/cli/aws/ec2/volumes.rb +10 -10
  17. data/lib/rudy/cli/backups.rb +5 -5
  18. data/lib/rudy/cli/base.rb +9 -9
  19. data/lib/rudy/cli/candy.rb +1 -1
  20. data/lib/rudy/cli/config.rb +6 -6
  21. data/lib/rudy/cli/disks.rb +5 -5
  22. data/lib/rudy/cli/images.rb +12 -12
  23. data/lib/rudy/cli/info.rb +9 -9
  24. data/lib/rudy/cli/keypairs.rb +5 -5
  25. data/lib/rudy/cli/machines.rb +26 -26
  26. data/lib/rudy/cli/metadata.rb +2 -2
  27. data/lib/rudy/cli/networks.rb +17 -8
  28. data/lib/rudy/cli/routines.rb +10 -10
  29. data/lib/rudy/config.rb +2 -2
  30. data/lib/rudy/config/objects.rb +1 -1
  31. data/lib/rudy/huxtable.rb +11 -5
  32. data/lib/rudy/machines.rb +4 -1
  33. data/lib/rudy/metadata/machine.rb +18 -9
  34. data/lib/rudy/routines.rb +4 -4
  35. data/lib/rudy/routines/handlers/base.rb +6 -6
  36. data/lib/rudy/routines/handlers/disks.rb +9 -9
  37. data/lib/rudy/routines/handlers/group.rb +1 -1
  38. data/lib/rudy/routines/handlers/rye.rb +7 -5
  39. data/lib/rudy/routines/handlers/script.rb +2 -2
  40. data/lib/rudy/routines/passthrough.rb +11 -4
  41. data/lib/rudy/routines/reboot.rb +16 -5
  42. data/lib/rudy/routines/shutdown.rb +14 -5
  43. data/lib/rudy/routines/startup.rb +5 -6
  44. data/lib/rudy/utils.rb +2 -2
  45. data/rudy.gemspec +1 -1
  46. metadata +2 -3
@@ -12,11 +12,11 @@ module AWS; module EC2;
12
12
  def create_keypairs
13
13
  kp = execute_action { Rudy::AWS::EC2::Keypairs.create(@argv.name) }
14
14
  if [:s, :string].member?(@@global.format)
15
- puts "Name: #{kp.name}"
16
- puts "Fingerprint: #{kp.fingerprint}", $/
17
- puts "Copy the following private key data into a file."
18
- puts "Set the permissions to 0600 and keep it safe.", $/
19
- puts kp.private_key
15
+ li "Name: #{kp.name}"
16
+ li "Fingerprint: #{kp.fingerprint}", $/
17
+ li "Copy the following private key data into a file."
18
+ li "Set the permissions to 0600 and keep it safe.", $/
19
+ li kp.private_key
20
20
  else
21
21
  print_stobject kp
22
22
  end
@@ -29,7 +29,7 @@ module AWS; module EC2;
29
29
  def destroy_keypairs
30
30
  raise "Keypair #{@argv.name} does not exist" unless Rudy::AWS::EC2::Keypairs.exists?(@argv.name)
31
31
  kp = Rudy::AWS::EC2::Keypairs.get(@argv.name)
32
- puts "Destroying: #{kp.name}"
32
+ li "Destroying: #{kp.name}"
33
33
  execute_check(:medium)
34
34
  execute_action { Rudy::AWS::EC2::Keypairs.destroy(kp.name) }
35
35
  end
@@ -23,7 +23,7 @@ module AWS; module EC2;
23
23
  true
24
24
  end
25
25
  def destroy_snapshots
26
- puts "Destroying: #{@snap.awsid}"
26
+ li "Destroying: #{@snap.awsid}"
27
27
  execute_check(:medium)
28
28
  execute_action { Rudy::AWS::EC2::Snapshots.destroy(@snap.awsid) }
29
29
  end
@@ -12,12 +12,12 @@ module AWS; module EC2;
12
12
  true
13
13
  end
14
14
  def volumes_create
15
- puts "Creating #{@option.size}GB volume in #{@@global.zone}"
15
+ li "Creating #{@option.size}GB volume in #{@@global.zone}"
16
16
  execute_check(:low)
17
17
  vol = execute_action("Create Failed") {
18
18
  Rudy::AWS::EC2::Volumes.create(@option.size, @@global.zone, @option.snapshot)
19
19
  }
20
- puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
20
+ li @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
21
21
  end
22
22
 
23
23
 
@@ -39,13 +39,13 @@ module AWS; module EC2;
39
39
  raise "Volume #{@volume.awsid} is still attached" if @volume.attached?
40
40
  raise "Volume #{@volume.awsid} is not available (#{@volume.state})" unless @volume.available?
41
41
 
42
- puts "Destroying #{@volume.awsid}"
42
+ li "Destroying #{@volume.awsid}"
43
43
  execute_check(:medium)
44
44
  execute_action("Destroy Failed") { Rudy::AWS::EC2::Volumes.destroy(@volume.awsid) }
45
45
 
46
46
  vol = Rudy::AWS::EC2::Volumes.get(@volume.awsid)
47
47
 
48
- puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
48
+ li @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
49
49
  end
50
50
 
51
51
 
@@ -60,14 +60,14 @@ module AWS; module EC2;
60
60
  raise "Volume #{@argv.volid} is already attached" if Rudy::AWS::EC2::Volumes.attached?(@argv.volid)
61
61
  raise "Instance #{@option.instance} does not exist" unless Rudy::AWS::EC2::Instances.exists?(@option.instance)
62
62
 
63
- puts "Attaching #{@argv.volid} to #{@option.instance} on #{@option.device}"
63
+ li "Attaching #{@argv.volid} to #{@option.instance} on #{@option.device}"
64
64
  execute_check(:low)
65
65
  execute_action("Attach Failed") {
66
66
  Rudy::AWS::EC2::Volumes.attach(@argv.volid, @option.instance, @option.device)
67
67
  }
68
68
 
69
69
  vol = Rudy::AWS::EC2::Volumes.get(@argv.volid)
70
- puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
70
+ li @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
71
71
  end
72
72
 
73
73
  def volumes_detach_valid?
@@ -80,21 +80,21 @@ module AWS; module EC2;
80
80
  vol = Rudy::AWS::EC2::Volumes.get(@argv.volid)
81
81
  raise "Volume #{vol.awsid} is not attached" unless vol.attached?
82
82
 
83
- puts "Detaching #{vol.awsid} from #{vol.instid}"
83
+ li "Detaching #{vol.awsid} from #{vol.instid}"
84
84
  execute_check(:medium)
85
85
  execute_action("Detach Failed") { Rudy::AWS::EC2::Volumes.detach(vol.awsid) }
86
86
 
87
87
  vol = Rudy::AWS::EC2::Volumes.get(vol.awsid)
88
- puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
88
+ li @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
89
89
  end
90
90
 
91
91
 
92
92
  def volumes
93
93
  volumes = Rudy::AWS::EC2::Volumes.list || []
94
94
  volumes.each do |vol|
95
- puts @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
95
+ li @global.verbose > 1 ? vol.inspect : vol.dump(@@global.format)
96
96
  end
97
- puts "No volumes" if volumes.empty?
97
+ li "No volumes" if volumes.empty?
98
98
  end
99
99
 
100
100
  end
@@ -13,12 +13,12 @@ module Rudy
13
13
  def backups_wash
14
14
  dirt = (get_backups || []).select { |b| !b.snapshot_exists? }
15
15
  if dirt.empty?
16
- puts "Nothing to wash in #{current_machine_group}"
16
+ li "Nothing to wash in #{current_machine_group}"
17
17
  return
18
18
  end
19
19
 
20
- puts "The following backup metadata will be deleted:"
21
- puts dirt.collect {|b| b.name }
20
+ li "The following backup metadata will be deleted:"
21
+ li dirt.collect {|b| b.name }
22
22
 
23
23
  execute_check(:medium)
24
24
 
@@ -38,9 +38,9 @@ module Rudy
38
38
 
39
39
  def backups_create
40
40
  @dlist.each do |d|
41
- puts "Creating backup for #{d.name}"
41
+ li "Creating backup for #{d.name}"
42
42
  back = d.archive
43
- puts back
43
+ li back
44
44
  end
45
45
  end
46
46
 
@@ -26,8 +26,8 @@ module Rudy::CLI
26
26
  begin
27
27
  Rudy::Huxtable.update_config
28
28
  rescue Caesars::SyntaxError => ex
29
- STDERR.puts ex.message
30
- STDERR.puts ex.backtrace if @@global.verbose > 0
29
+ le ex.message
30
+ le ex.backtrace if @@global.verbose > 0
31
31
  exit 81
32
32
  end
33
33
 
@@ -41,13 +41,13 @@ module Rudy::CLI
41
41
  end
42
42
 
43
43
  unless @@global.accesskey && @@global.secretkey
44
- STDERR.puts "No AWS credentials. Check your configs!"
45
- STDERR.puts "Try: rudy init"
44
+ le "No AWS credentials. Check your configs!"
45
+ le "Try: rudy init"
46
46
  exit 1
47
47
  end
48
48
 
49
49
  if @@global.environment =~ /^prod/ && Rudy.debug?
50
- puts Rudy::Utils.banner("PRODUCTION ACCESS IS DISABLED IN DEBUG MODE")
50
+ li Rudy::Utils.banner("PRODUCTION ACCESS IS DISABLED IN DEBUG MODE")
51
51
  exit 1
52
52
  end
53
53
 
@@ -55,7 +55,7 @@ module Rudy::CLI
55
55
  format = @@global.format == :json ? :json : :yaml
56
56
  gcopy = @@global.dup
57
57
  gcopy.secretkey = "[HIDDEN]"
58
- puts "# GLOBALS: ", gcopy.dump(format)
58
+ li "# GLOBALS: ", gcopy.dump(format)
59
59
  end
60
60
 
61
61
  Rudy::Metadata.connect @@global.accesskey, @@global.secretkey, @@global.region
@@ -86,12 +86,12 @@ module Rudy::CLI
86
86
  # updated after initialization but before the command was executed
87
87
  Rudy::Huxtable.update_global @global
88
88
 
89
- puts Rudy::CLI.generate_header(@@global, @@config) if @@global.print_header
89
+ li Rudy::CLI.generate_header(@@global, @@config) if @@global.print_header
90
90
 
91
91
  unless @@global.quiet
92
92
  if @@global.environment == "prod"
93
93
  msg = "YOU ARE PLAYING WITH PRODUCTION"
94
- puts Rudy::Utils.banner(msg, :normal), $/
94
+ li Rudy::Utils.banner(msg, :normal), $/
95
95
  end
96
96
  end
97
97
  end
@@ -108,7 +108,7 @@ module Rudy::CLI
108
108
  format = @@global.format
109
109
  format = :yaml if @@global.verbose > 0 && @@global.format == :string
110
110
  format = :string if noverbose
111
- puts obj.dump(format)
111
+ li obj.dump(format)
112
112
  end
113
113
 
114
114
  def machine_separator(name, awsid)
@@ -9,7 +9,7 @@ module Rudy
9
9
  if machines
10
10
  `open http://#{machines.first.dns_public}`
11
11
  else
12
- puts "No machines"
12
+ li "No machines"
13
13
  end
14
14
  end
15
15
 
@@ -50,23 +50,23 @@ module Rudy
50
50
  if @option.project
51
51
  rf = File.join(RUDY_HOME, 'Rudyfile')
52
52
  raise "Cannot find: #{rf}" unless File.exists?(rf)
53
- puts File.read(rf)
53
+ li File.read(rf)
54
54
 
55
55
  elsif @option.script
56
56
  conf = fetch_script_config
57
- puts conf.to_hash.send(outform) if conf
57
+ li conf.to_hash.send(outform) if conf
58
58
 
59
59
  else
60
- #puts "# ACCOUNTS: [not displayed]" if types.delete(:accounts)
60
+ #li "# ACCOUNTS: [not displayed]" if types.delete(:accounts)
61
61
  types.each do |conftype|
62
- puts "# #{conftype.to_s.upcase}"
62
+ li "# #{conftype.to_s.upcase}"
63
63
  next unless @@config[conftype] # Nothing to output
64
64
  if conftype == :accounts
65
65
  skey = @@config[conftype][:aws][:secretkey]
66
66
  @@config[conftype][:aws][:secretkey] = hide_secret_key(skey)
67
67
  end
68
68
 
69
- puts @@config[conftype].to_hash.send(outform)
69
+ li @@config[conftype].to_hash.send(outform)
70
70
  end
71
71
  end
72
72
 
@@ -81,7 +81,7 @@ module Rudy
81
81
  gtmp = @@global.clone
82
82
  gtmp.format = "yaml" if gtmp.format == :s || gtmp.format == :string
83
83
  gtmp.secretkey = hide_secret_key(gtmp.secretkey)
84
- puts gtmp.dump(gtmp.format)
84
+ li gtmp.dump(gtmp.format)
85
85
  end
86
86
 
87
87
  private
@@ -22,7 +22,7 @@ module Rudy
22
22
  print_stobject d
23
23
  if @option.backups
24
24
  d.backups.each_with_index do |b, index|
25
- puts ' %s' % b.name
25
+ li ' %s' % b.name
26
26
  ##break if @option.all.nil? && index >= 2 # display only 3, unless all
27
27
  end
28
28
  end
@@ -32,12 +32,12 @@ module Rudy
32
32
  def disks_wash
33
33
  dirt = (get_disks || []).select { |d| !d.volume_exists? }
34
34
  if dirt.empty?
35
- puts "Nothing to wash in #{current_machine_group}"
35
+ li "Nothing to wash in #{current_machine_group}"
36
36
  return
37
37
  end
38
38
 
39
- puts "The following disk metadata will be deleted:"
40
- puts dirt.collect {|d| d.name }
39
+ li "The following disk metadata will be deleted:"
40
+ li dirt.collect {|d| d.name }
41
41
 
42
42
  execute_check(:medium)
43
43
 
@@ -63,7 +63,7 @@ module Rudy
63
63
 
64
64
  def disks_create
65
65
  @mlist.each do |m|
66
- puts machine_separator(m.name, m.instid)
66
+ li machine_separator(m.name, m.instid)
67
67
  rbox = Rudy::Routines::Handlers::RyeTools.create_box m
68
68
  rbox.stash = m
69
69
  disk = Rudy::Disk.new m.position, @argv.first
@@ -19,7 +19,7 @@ module Rudy
19
19
  def bundle
20
20
 
21
21
  @machines.each do |m|
22
- puts machine_separator(m.name, m.instid)
22
+ li machine_separator(m.name, m.instid)
23
23
 
24
24
  cmd = "ec2-bundle-instance"
25
25
  args = [m.instid, "--region", @@global.region.to_s]
@@ -31,21 +31,21 @@ module Rudy
31
31
  args += ["--no-bucket-setup"] if @@global.region.to_s == 'eu-west-1'
32
32
 
33
33
  if @@global.verbose > 0
34
- puts "Running: " << Rye.prepare_command(cmd, args), $/
34
+ li "Running: " << Rye.prepare_command(cmd, args), $/
35
35
  end
36
36
 
37
37
  unless @@global.quiet
38
- puts "Bundling can take up to 60 minutes."
39
- puts "Check the status with the following command:"
40
- puts Rudy::Huxtable.generate_rudy_command('bundle-status').bright
41
- puts $/, "When complete, register the image with the command:"
42
- puts Rudy::Huxtable.generate_rudy_command('images', '-R', @argv.name).bright
38
+ li "Bundling can take up to 60 minutes."
39
+ li "Check the status with the following command:"
40
+ li Rudy::Huxtable.generate_rudy_command('bundle-status').bright
41
+ li $/, "When complete, register the image with the command:"
42
+ li Rudy::Huxtable.generate_rudy_command('images', '-R', @argv.name).bright
43
43
  end
44
44
 
45
45
  execute_check(:medium)
46
46
 
47
47
  ret = Rye.shell cmd, args
48
- puts ret.stderr, ret.stdout
48
+ li ret.stderr, ret.stdout
49
49
  end
50
50
  end
51
51
 
@@ -55,11 +55,11 @@ module Rudy
55
55
  args += ["-K", @@global.pkey, "-C", @@global.cert]
56
56
 
57
57
  if @@global.verbose > 0
58
- puts "Running: " << Rye.prepare_command(cmd, args), $/
58
+ li "Running: " << Rye.prepare_command(cmd, args), $/
59
59
  end
60
60
 
61
61
  ret = Rye.shell cmd, args
62
- puts ret.stderr, ret.stdout
62
+ li ret.stderr, ret.stdout
63
63
 
64
64
  end
65
65
 
@@ -71,7 +71,7 @@ module Rudy
71
71
  end
72
72
  def register_images
73
73
  name = "#{@@global.bucket}/#{@argv.name}.manifest.xml"
74
- puts Rudy::AWS::EC2::Images.register(name)
74
+ li Rudy::AWS::EC2::Images.register(name)
75
75
  end
76
76
 
77
77
  def deregister_images_valid?
@@ -82,7 +82,7 @@ module Rudy
82
82
  end
83
83
  def deregister_images
84
84
  execute_check(:low)
85
- puts Rudy::AWS::EC2::Images.deregister(@argv.ami) ? "Done" : "Unknown error"
85
+ li Rudy::AWS::EC2::Images.deregister(@argv.ami) ? "Done" : "Unknown error"
86
86
  end
87
87
 
88
88
  def images
@@ -13,34 +13,34 @@ module Rudy
13
13
  process_region region
14
14
  end
15
15
  else
16
- puts $/, "Other regions: " << oregions.join(', ')
16
+ li $/, "Other regions: " << oregions.join(', ')
17
17
  end
18
18
  end
19
19
 
20
20
 
21
21
  private
22
22
  def process_region(region)
23
- puts " Region: %s %30s".att(:reverse) % [region, '']
24
- puts " Machines".bright
23
+ li " Region: %s %30s".att(:reverse) % [region, '']
24
+ li " Machines".bright
25
25
 
26
26
  (get_machines(:region => region) rescue []).collect do |m|
27
27
  m.refresh!
28
- puts " " << m.to_s.noatt
28
+ li " " << m.to_s.noatt
29
29
  end
30
30
 
31
- puts " Disks".bright
31
+ li " Disks".bright
32
32
  (get_disks(:region => region) || []).collect do |d|
33
33
  d.refresh!
34
- puts " " << d.to_s.noatt
34
+ li " " << d.to_s.noatt
35
35
  end
36
36
 
37
- puts " Backups".bright
37
+ li " Backups".bright
38
38
  (get_backups(:region => region) || []).collect do |b|
39
39
  b.refresh!
40
- puts " " << b.to_s.noatt
40
+ li " " << b.to_s.noatt
41
41
  end
42
42
 
43
- puts
43
+ li
44
44
  end
45
45
 
46
46
  end
@@ -10,7 +10,7 @@ module Rudy
10
10
  end
11
11
 
12
12
  def keypairs_add
13
- puts current_group_name
13
+ li current_group_name
14
14
  end
15
15
 
16
16
  def keypairs_valid?
@@ -22,7 +22,7 @@ module Rudy
22
22
  end
23
23
 
24
24
  def keypairs
25
- puts Rudy::AWS::EC2::Keypairs.get(current_user_keypairname)
25
+ li Rudy::AWS::EC2::Keypairs.get(current_user_keypairname)
26
26
  end
27
27
 
28
28
  def keypairs_show_valid?
@@ -32,9 +32,9 @@ module Rudy
32
32
  def keypairs_show
33
33
  content = File.read(@pkey)
34
34
  rkey = Rye::Key.new content
35
- puts "# #{@pkey}"
36
- puts content
37
- puts rkey.public_key
35
+ li "# #{@pkey}"
36
+ li content
37
+ li rkey.public_key
38
38
  end
39
39
 
40
40
  end
@@ -12,16 +12,16 @@ module Rudy
12
12
  def machines_console
13
13
  mlist = get_machines
14
14
  mlist.each do |machine|
15
- puts machine_separator(machine.name, machine.instid)
16
- puts machine.get_console
15
+ li machine_separator(machine.name, machine.instid)
16
+ li machine.get_console
17
17
  end
18
18
  end
19
19
 
20
20
  def machines_password
21
21
  mlist = get_machines
22
22
  mlist.each do |machine|
23
- puts machine_separator(machine.name, machine.instid)
24
- puts "Password for %s: %s" % [machine.dns_public, machine.get_password]
23
+ li machine_separator(machine.name, machine.instid)
24
+ li "Password for %s: %s" % [machine.dns_public, machine.get_password]
25
25
  end
26
26
  Rudy::Routines::Handlers::Group.authorize rescue nil
27
27
  end
@@ -31,12 +31,12 @@ module Rudy
31
31
  dirt = mlist.select { |m| !m.instance_running? }
32
32
 
33
33
  if dirt.empty?
34
- puts "Nothing to wash in #{current_machine_group}"
34
+ li "Nothing to wash in #{current_machine_group}"
35
35
  return
36
36
  end
37
37
 
38
- puts "The following machine metadata will be deleted:".bright
39
- puts dirt.collect {|m| m.name.bright }
38
+ li "The following machine metadata will be deleted:".bright
39
+ li dirt.collect {|m| m.name.bright }
40
40
  execute_check(:medium)
41
41
 
42
42
  dirt.each do |m|
@@ -92,8 +92,8 @@ module Rudy
92
92
 
93
93
  def associate_machines
94
94
 
95
- puts "Assigning static IP addresses for:"
96
- puts @mlist.collect { |m| m.name }
95
+ li "Assigning static IP addresses for:"
96
+ li @mlist.collect { |m| m.name }
97
97
 
98
98
  execute_check(:medium)
99
99
 
@@ -101,7 +101,7 @@ module Rudy
101
101
  next if @mlist_static.member?(m)
102
102
  address = @alist_unused.shift
103
103
  address ||= Rudy::AWS::EC2::Addresses.create.ipaddress
104
- puts "Associating #{address} to #{m.name} (#{m.instid})"
104
+ li "Associating #{address} to #{m.name} (#{m.instid})"
105
105
  Rudy::AWS::EC2::Addresses.associate(address, m.instid)
106
106
  sleep 2
107
107
  m.refresh!
@@ -116,7 +116,7 @@ module Rudy
116
116
 
117
117
  unless @mlist_static.empty?
118
118
  @mlist_static.each do |m|
119
- puts "%s: %s" % [m.name, m.dns_public]
119
+ li "%s: %s" % [m.name, m.dns_public]
120
120
  end
121
121
  end
122
122
  end
@@ -137,15 +137,15 @@ module Rudy
137
137
 
138
138
  def disassociate_machines
139
139
  if @mlist_static.empty?
140
- puts "No machines in #{current_group_name} have static IP addresses"
140
+ li "No machines in #{current_group_name} have static IP addresses"
141
141
  else
142
- puts "The following machines will be updated:"
143
- puts @mlist_static.collect { |m| m.name }
144
- puts "NOTE: Unassigned IP addresses are not removed from your account"
142
+ li "The following machines will be updated:"
143
+ li @mlist_static.collect { |m| m.name }
144
+ li "NOTE: Unassigned IP addresses are not removed from your account"
145
145
  execute_check(:medium)
146
146
  @mlist_static.each do |m|
147
147
  address = Resolv.getaddress m.dns_public
148
- puts "Disassociating #{address} from #{m.name} (#{m.instid})"
148
+ li "Disassociating #{address} from #{m.name} (#{m.instid})"
149
149
  Rudy::AWS::EC2::Addresses.disassociate(address)
150
150
  end
151
151
  end
@@ -156,7 +156,7 @@ module Rudy
156
156
  rset = Rye::Set.new(current_group_name, :parallel => @@global.parallel, :user => 'root')
157
157
  os = current_machine_os
158
158
  mlist.each do |m|
159
- puts "Updating #{m.name}"
159
+ li "Updating #{m.name}"
160
160
  m.refresh!
161
161
  rbox = Rye::Box.new(m.dns_public, :user => 'root')
162
162
  rbox.add_key user_keypairpath('root')
@@ -164,16 +164,16 @@ module Rudy
164
164
  rbox.stash = m
165
165
  rset.add_boxes rbox
166
166
  if m.os.to_s != os.to_s
167
- puts "os: #{os}"
167
+ li "os: #{os}"
168
168
  m.os = os
169
169
  end
170
170
  m.save :replace
171
171
  end
172
172
 
173
173
  unless os.to_s == 'windows'
174
- puts "Updating hostnames for #{current_group_name}"
174
+ li "Updating hostnames for #{current_group_name}"
175
175
  Rudy::Routines::Handlers::Host.set_hostname rset
176
- puts rset.hostname.flatten
176
+ li rset.hostname.flatten
177
177
  end
178
178
 
179
179
  end
@@ -188,7 +188,7 @@ module Rudy
188
188
  Rudy::Utils.service_available?(m.dns_public, port)
189
189
  }
190
190
  available = Rudy::Utils.service_available?(m.dns_public, port)
191
- puts available ? 'up' : 'down'
191
+ li available ? 'up' : 'down'
192
192
  end
193
193
 
194
194
  end
@@ -205,7 +205,7 @@ module Rudy
205
205
  # TODO: Give this method a good look over
206
206
  pkey = current_user_keypairpath
207
207
  unless pkey
208
- puts "No private key configured for #{current_machine_user} in #{current_machine_group}"
208
+ li "No private key configured for #{current_machine_user} in #{current_machine_group}"
209
209
  end
210
210
 
211
211
  # Options to be sent to Rye::Box
@@ -221,7 +221,7 @@ module Rudy
221
221
  local_keys = Rye.keys
222
222
  rye_opts[:keys] += local_keys if local_keys.is_a?(Array)
223
223
 
224
- puts "# SSH OPTS", rye_opts.to_yaml if @@global.verbose > 3
224
+ li "# SSH OPTS", rye_opts.to_yaml if @@global.verbose > 3
225
225
 
226
226
  # The user specified a command to run. We won't create an interactive
227
227
  # session so we need to prepare the command and its arguments
@@ -251,9 +251,9 @@ module Rudy
251
251
  if @@global.quiet
252
252
  print "You are #{rye_opts[:user].to_s.bright}. " if !checked # only the 1st
253
253
  else
254
- puts machine_separator(machine.name, machine.instid)
255
- puts "Connecting #{rye_opts[:user].to_s.bright}@#{machine.dns_public} "
256
- puts
254
+ li machine_separator(machine.name, machine.instid)
255
+ li "Connecting #{rye_opts[:user].to_s.bright}@#{machine.dns_public} "
256
+ li
257
257
  end
258
258
  else
259
259
  unless @global.parallel