Class: Chef::Knife::CfnCreate
- Inherits:
-
CfnBase
- Object
- Chef::Knife
- CfnBase
- Chef::Knife::CfnCreate
- Defined in:
- lib/chef/knife/cfn_create.rb
Instance Method Summary collapse
Methods inherited from CfnBase
#connection, included, #locate_config_value, #msg_pair, #validate!
Methods inherited from Chef::Knife
#create_create_def, #create_update_def
Instance Method Details
#run ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/chef/knife/cfn_create.rb', line 74 def run $stdout.sync = true validate! stack_name = @name_args[0] if stack_name.nil? show_usage ui.error("You must specify a stack name") exit 1 end begin response = connection.create_stack(stack_name, create_create_def) rescue Excon::Errors::BadRequest => e i= e.response.body.index("<Message>") j = e.response.body.index("</Message>") if !i.nil? and !j.nil? ui.error(e.response.body[i+9,j-i-9]) else print "\n#{e.response.body}" end exit 1 else = "Stack #{stack_name} creation started" print "\n#{ui.color(, :green)}\n" end end |