Skip to content
Snippets Groups Projects
Commit ce3d565f authored by Dmitry E. Oboukhov's avatar Dmitry E. Oboukhov
Browse files

net.box requires define password AND user. closes #545

parent 266466e1
No related branches found
No related tags found
No related merge requests found
......@@ -351,10 +351,21 @@ local remote_methods = {
self.host = host
self.port = port
self.opts = opts
if self.opts == nil then
self.opts = {}
end
if self.opts.user ~= nil and self.opts.password == nil then
box.error(box.error.PROC_LUA,
"net.box: password is not defined")
end
if self.opts.user == nil and self.opts.password ~= nil then
box.error(box.error.PROC_LUA,
"net.box: user is not defined")
end
if self.host == nil then
self.host = 'localhost'
end
......
......@@ -573,3 +573,12 @@ cnc:call('123')
---
- error: '[string "123()"]:1: unexpected symbol near ''123'''
...
-- #545 user or password is not defined
remote:new(LISTEN.host, LISTEN.service, { user = 'test' })
---
- error: 'net.box: password is not defined'
...
remote:new(LISTEN.host, LISTEN.service, { password = 'test' })
---
- error: 'net.box: user is not defined'
...
......@@ -223,3 +223,9 @@ cnc:call('console_unpack_test', 1)
cn:call('123')
cnc:call('123')
-- #545 user or password is not defined
remote:new(LISTEN.host, LISTEN.service, { user = 'test' })
remote:new(LISTEN.host, LISTEN.service, { password = 'test' })
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment