Class: CopyAmi::TargetVolumeReadyState
- Inherits:
-
CopyAmiState
- Object
- ScriptExecutionState
- CopyAmiState
- CopyAmi::TargetVolumeReadyState
- Defined in:
- lib/scripts/ec2/copy_ami.rb
Overview
Storages are ready. Only thing missing: the key of the target region must be available on the instance in the source region to be able to perform a remote copy.
Instance Attribute Summary
Attributes inherited from ScriptExecutionState
Instance Method Summary collapse
Methods inherited from CopyAmiState
load_state, #local_region, #remote_region
Methods inherited from ScriptExecutionState
#done?, #end_state, #failed?, #initialize, #register_state_change_listener, #start_state_machine, #to_s
Methods included from StateTransitionHelper
#attach_volume, #connect, #copy_distribution, #create_fs, #create_snapshot, #create_volume, #create_volume_from_snapshot, #delete_snapshot, #delete_volume, #detach_volume, #determine_file, #disconnect, #ec2_handler, #ec2_handler=, #launch_instance, #mount_fs, #register_snapshot, #remote_copy, #remote_handler, #remote_handler=, #retrieve_instances, #retrieve_security_groups, #shut_down_instance, #start_instance, #unmount_fs, #upload_file, #zip_volume
Constructor Details
This class inherits a constructor from ScriptExecutionState
Instance Method Details
#enter ⇒ Object
165 166 167 168 169 170 171 172 173 174 |
# File 'lib/scripts/ec2/copy_ami.rb', line 165 def enter() ("upload key of target-instance to source-instance...") path_candidates = ["/#{@context[:source_ssh_username]}/.ssh/", "/home/#{@context[:source_ssh_username]}/.ssh/"] key_path = determine_file(@context[:source_dns_name], @context[:source_ssh_username], @context[:source_ssh_keydata], path_candidates) upload_file(@context[:source_dns_name], @context[:source_ssh_username], @context[:source_ssh_keydata], @context[:target_ssh_keyfile], "#{key_path}#{@context[:target_key_name]}.pem") ("credentials are in place to connect source and target.") KeyInPlaceState.new(@context) end |