1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-26 06:50:09 +03:00

M #: minor one_im_exec improvements (#1115)

This commit is contained in:
Christian González 2021-04-16 12:58:27 +02:00 committed by GitHub
parent 4f151a4347
commit d6fb182127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,10 +131,10 @@ class InformationManagerDriver < OpenNebulaDriver
:stdin => config_xml.to_s}]
rescue StandardError => e
msg = Zlib::Deflate.deflate(e.message, Zlib::BEST_COMPRESSION)
msg = Base64.strict_encode64(msg)
send_message(msg_type, RESULT[:failure], host_id, msg)
write_respond(msg_type,
RESULT[:failure],
host_id,
e.message)
[-1, {}]
end
@ -146,11 +146,10 @@ class InformationManagerDriver < OpenNebulaDriver
cmd = SSHCommand.run(mkdir_cmd, hostname, log_method(hostid))
if cmd.code != 0
msg = Zlib::Deflate.deflate('Could not update remotes',
Zlib::BEST_COMPRESSION)
msg = Base64.strict_encode64(msg)
send_message(action, RESULT[:failure], hostid, msg)
write_respond(action,
RESULT[:failure],
hostid,
'Could not update remotes')
return -1
end
@ -165,11 +164,10 @@ class InformationManagerDriver < OpenNebulaDriver
cmd = LocalCommand.run(sync_cmd, log_method(hostid))
if cmd.code != 0
msg = Zlib::Deflate.deflate('Could not update remotes',
Zlib::BEST_COMPRESSION)
msg = Base64.strict_encode64(msg)
send_message(action, RESULT[:failure], hostid, msg)
write_respond(action,
RESULT[:failure],
hostid,
'Could not update remotes')
return -1
end
@ -213,10 +211,7 @@ class InformationManagerDriver < OpenNebulaDriver
end
end
zline = Zlib::Deflate.deflate(line.strip, Zlib::BEST_COMPRESSION)
zline64 = Base64.strict_encode64(zline)
send_message('LOG', severity, id, "#{Time.now.to_i} #{zline64}")
write_respond('LOG', severity, id, line.strip)
end
end