#730: more accurate chef bootstrap errors handling
This commit is contained in:
parent
feef03efc5
commit
ddb79f82e9
@ -178,6 +178,7 @@ module Devops
|
||||
provider = @server.provider_instance
|
||||
@server.chef_node_name = provider.create_default_chef_node_name(@server) if @server.chef_node_name.nil?
|
||||
r = @knife_instance.knife_bootstrap(@out, ip, self.bootstrap_options(ja, options))
|
||||
|
||||
if r == 0
|
||||
@out << "Chef node name: #{@server.chef_node_name}\n"
|
||||
::Devops::Db.connector.server_set_chef_node_name @server
|
||||
@ -185,12 +186,14 @@ module Devops
|
||||
@out << "After bootstrap hooks...\n"
|
||||
res = self.run_hook(:after_bootstrap, @out)
|
||||
@out << "Done\n"
|
||||
@out.flush
|
||||
DevopsLogger.logger.info "Server with id '#{@server.id}' is bootstraped"
|
||||
r
|
||||
else
|
||||
@out << "Can not bootstrap node '#{@server.id}', error code: #{r}"
|
||||
@out.flush
|
||||
result_code(:server_bootstrap_fail)
|
||||
end
|
||||
@out.flush
|
||||
r
|
||||
end
|
||||
|
||||
def bootstrap_options attributes, options
|
||||
|
||||
Loading…
Reference in New Issue
Block a user