Commit 3de2c964 authored by Hugo Roenick's avatar Hugo Roenick
Browse files

Commit do item [OPENBUS-2238]: Erro ao tentar adicionar ou atualizar um...

Commit do item [OPENBUS-2238]: Erro ao tentar adicionar ou atualizar um certificado através do comando "--add-certificate" do busadmin
 - resolvendo o item no branch 02_00_00

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/branches/02_00_00@141720 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 208d0fa0
......@@ -64,8 +64,8 @@ Por padr
--password
* Realiza o login por senha.
--password=<password>
* Realiza o login por certificado.
--certificate=<certificate>
* Realiza o login com chave privada.
--privatekey=<private key>
* Aciona o verbose da API OpenBus.
--verbose=<level>
* Aciona o verbose do OiL.
......@@ -174,7 +174,7 @@ local options = {
oilverbose = 0,
verbose = 0,
password = null,
certificate = null,
privatekey = null,
}
--
......@@ -1399,9 +1399,9 @@ function handleError(err)
end
function doLogin(conn)
if certificate ~= null then
local privatekey = assert(openbus.readKeyFile(certificate))
local ok, err = pcall(conn.loginByCertificate, conn, login, privatekey)
if privatekey ~= null then
local prvkey = assert(openbus.readKeyFile(privatekey))
local ok, err = pcall(conn.loginByCertificate, conn, login, prvkey)
if not ok then
handleError(err)
return false
......@@ -1471,7 +1471,7 @@ return function(...)
-- Recupera os valores globais
login = command.params.login
certificate = command.params.certificate
privatekey = command.params.privatekey
password = command.params.password
host = command.params["host"]
port = tonumber(command.params["port"])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment