[tarantool-patches] Re: [PATCH 2/3] Allow use existing user
Vladislav Shpilevoy
v.shpilevoy at tarantool.org
Tue Jun 26 14:11:44 MSK 2018
Thanks for the fixes! The patch is pushed.
On 26/06/2018 00:55, Alex Khatskevich wrote:
>
>>> @@ -138,11 +138,19 @@ end
>>> --------------------------------------------------------------------------------
>>> -- Schema
>>> --------------------------------------------------------------------------------
>>> +local function create_user(username, password)
>>> + box.schema.user.create(username, {
>>> + password = password,
>>> + if_not_exists = true,
>>> + })
>>> + -- Replication may has not been granted, if user exists.
>>> + box.schema.user.grant(username, 'replication', nil, nil,
>>> + {if_not_exists = true})
>>> +end
>>> local function storage_schema_v1(username, password)
>>> log.info("Initializing schema")
>>> - box.schema.user.create(username, {password = password})
>>> - box.schema.user.grant(username, 'replication')
>>> + create_user(username, password)
>>
>> 1. Please, just inline this function. It is not needed anywhere else
>> and is extremely simple.
>>
> done
>
More information about the Tarantool-patches
mailing list