fixed bootstrap stream

This commit is contained in:
amartynov 2015-08-10 13:17:04 +03:00
parent 2961b402b4
commit 05e9ef3266

View File

@ -143,20 +143,22 @@ module Devops
# TODO: check bootstrap template name
def bootstrap_server_stream out
s = prepare_create_server
s, rl, bt = prepare_bootstrap_server
status = []
cert = Devops::Db.connector.key s.key
logger.debug "Bootstrap certificate path: #{cert.path}"
bootstrap s, out, cert.path, logger
DevopsLogger.logger.debug "Bootstrap certificate path: #{cert.path}"
#bootstrap s, out, cert.path, logger
provider = ::Provider::ProviderFactory.get(s.provider)
r = two_phase_bootstrap s, provider.run_list, bt, cert.path, out
str = nil
r = if check_server(s)
Devops::Db.connector.server_set_chef_node_name s
str = "Server with id '#{s.id}' is bootstraped"
logger.info str
DevopsLogger.logger.info str
0
else
str = "Server with id '#{s.id}' is not bootstraped"
logger.warn str
DevopsLogger.logger.warn str
1
end
status.push r
@ -171,7 +173,6 @@ module Devops
files = []
uri = URI.parse(@request.url)
h = s.to_hash
# h["options"] = s.options
h["_id"] = s.id
jid = BootstrapWorker.perform_async(dir, s.provider, h, bt, parser.current_user, DevopsConfig.config)
Worker.set_status jid, Worker::STATUS::IN_QUEUE