Skip to content

Commit aad7ea9

Browse files
committedJul 17, 2011
Fix-up issues with multi-vms and name arguments
1 parent 5bec715 commit aad7ea9

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed
 

‎README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ with AWS. Note that AMI creation is only supported for EBS-backed instances.
5757

5858
## Caveats
5959

60-
`vagrant-aws` is "pre-alpha" and currently only supports creation, suspension, resumption
61-
and descruction of the Vagrant environment. Provisioning should be supported for shell,
62-
chef-server and chef-solo, but has only been tested with chef-solo and on an Ubuntu guest.
63-
Only a subset of Vagrant features are supported. Currently port forwarding and shared
64-
directories are not implemented, nor is host networking (although that is less relevant for AWS).
65-
`vagrant-aws` in general has only been tested for a single VM, on OSX 10.6, with chef-solo.
60+
`vagrant-aws` is "pre-alpha" and currently supports creation, suspension,
61+
resumption and descruction of the Vagrant environment along with basic box
62+
operations. Provisioning should be supported for shell, chef-server and
63+
chef-solo, but has only been tested with chef-solo and on an Ubuntu guest.
64+
Only a subset of Vagrant features are supported. Currently port forwarding and
65+
shared directories are not implemented, nor is host networking (although that
66+
is less relevant for AWS). `vagrant-aws` in general has only been tested with
67+
ruby 1.9.2 on OSX 10.6, with chef-solo.

‎lib/vagrant-aws/command.rb

+10-10
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ def destroy(name=nil)
3636
end
3737

3838

39-
desc "status", "Show the status of the current Vagrant AWS environment."
40-
def status
39+
desc "status [NAME]", "Show the status of the current Vagrant AWS environment."
40+
def status(name=nil)
4141
state = nil
42-
results = target_vms.collect do |vm|
42+
results = target_vms(name).collect do |vm|
4343
state = vm.created? ? vm.vm.state.to_s : 'not_created'
4444
"#{vm.name.to_s.ljust(25)}#{state.gsub("_", " ")}"
4545
end
46-
state = target_vms.length == 1 ? state : "listing"
46+
state = target_vms(name).length == 1 ? state : "listing"
4747
@env.ui.info(I18n.t("vagrant.commands.status.output",
4848
:states => results.join("\n"),
4949
:message => I18n.t("vagrant.plugins.aws.commands.status.#{state}")),
@@ -54,9 +54,9 @@ def status
5454
desc "ssh [NAME]", "SSH into the currently running Vagrant AWS environment."
5555
method_options %w( execute -e ) => :string
5656
def ssh(name=nil)
57-
raise Vagrant::Errors::MultiVMTargetRequired, :command => "ssh" if target_vms.length > 1
57+
raise Vagrant::Errors::MultiVMTargetRequired, :command => "ssh" if target_vms(name).length > 1
5858

59-
ssh_vm = target_vms.first
59+
ssh_vm = target_vms(name).first
6060
ssh_vm.env.actions.run(VagrantAWS::Action::PopulateSSH)
6161

6262
if options[:execute]
@@ -113,9 +113,9 @@ def resume(name=nil)
113113
desc "ssh_config [NAME]", "outputs .ssh/config valid syntax for connecting to this environment via ssh"
114114
method_options %w{ host_name -h } => :string
115115
def ssh_config(name=nil)
116-
raise Vagrant::Errors::MultiVMTargetRequired, :command => "ssh_config" if target_vms.length > 1
116+
raise Vagrant::Errors::MultiVMTargetRequired, :command => "ssh_config" if target_vms(name).length > 1
117117

118-
ssh_vm = target_vms.first
118+
ssh_vm = target_vms(name).first
119119
raise Vagrant::Errors::VMNotCreatedError if !ssh_vm.created?
120120
ssh_vm.env.actions.run(VagrantAWS::Action::PopulateSSH)
121121

@@ -134,9 +134,9 @@ def ssh_config(name=nil)
134134
method_option :image_name, :aliases => '-f', :type => :string, :banner => "name of created image"
135135
method_option :image_desc, :aliases => '-d', :type => :string, :banner => "description of created image"
136136
def box_create(name=nil)
137-
raise Vagrant::Errors::MultiVMTargetRequired, :command => "box_create" if target_vms.length > 1
137+
raise Vagrant::Errors::MultiVMTargetRequired, :command => "box_create" if target_vms(name).length > 1
138138

139-
ami_vm = target_vms.first
139+
ami_vm = target_vms(name).first
140140
ami_vm.env.actions.run(:aws_create_image, {
141141
'package.output' => options[:image_name] || env.config.package.name,
142142
'image.register' => options[:register],

‎locales/en.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,56 +7,56 @@ en:
77
errors:
88
not_yet_supported: This feature is not yet supported in Vagrant AWS.
99
key_name_not_specified: An AWS key name was not specified. Set `aws.key_name` in Vagrantfile.
10-
private_key_file_not_specified: |-
10+
private_key_file_not_specified: |
1111
Private key file was not specified. Set `aws.private_key_file` to
1212
point to key file associated with the specified AWS key name.
13-
ebs_device_required: |-
13+
ebs_device_required: |
1414
%{command} requires an EBS-backed instance. Please Amazon AWS documentation for
1515
more information about EBS vs. instance store backed instances.
1616
vm_create_failure: VM creation failed.
1717
commands:
1818
status:
19-
running: |-
19+
running: |
2020
The VM is running. To stop this VM, you can run `vagrant aws suspend` to
2121
stop but not destroy this VM (you only pay for the backing EBS volume,
2222
not the hourly EC2 server cost) or `vagrant aws destroy` to destroy
2323
the VM entirely.
24-
stopping: |-
24+
stopping: |
2525
The VM is in the process of stopping (suspending). To resume this VM
2626
after it has completely stopped, simply run `vagrant aws resume`.
2727
stopped: To resume this VM, simply run `vagrant resume`.
2828
pending: The VM is in the process of resuming.
29-
not_created: |-
29+
not_created: |
3030
The environment has not yet been created. Run `vagrant aws resume` to
3131
create the environment.
32-
listing: |-
32+
listing: |
3333
This environment represents multiple VMs. The VMs are all listed
3434
above with their current state. For more information about a specific
3535
VM, run `vagrant aws status NAME`.
3636
actions:
3737
create:
3838
creating: "Creating VM ..."
39-
created: |-
39+
created: |
4040
Created EC2 server %{id}. Waiting for server to become ready
4141
(this may take a few minutes).
42-
available: |-
42+
available: |
4343
Server available at %{dns}.
4444
Waiting for SSH to become available. When ready run `vagrant aws ssh_config`
4545
for more detailed connection information.
4646
prepare_provisioners:
47-
chef_not_detected: |-
47+
chef_not_detected: |
4848
%{binary} not detected. Bootstrapping %{binary} installation. This may
4949
take a few minutes.
5050
uploading_chef_resources: Uploading chef resources to VM.
5151
create_image:
52-
creating: |-
52+
creating: |
5353
Creating AWS AMI. This make take a few minutes. The VM will not be available
5454
during this period.
5555
deregister_image:
5656
deregistering:
5757
Deregistering image %{image} with AWS.
5858
create_ssh_key:
59-
created: |-
59+
created: |
6060
No key pairs specified. Created AWS key pair named %{name}.
6161
6262

0 commit comments

Comments
 (0)
Please sign in to comment.