Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alex Khatskevich <avkhatskevich@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH 2/3] Allow use existing user
Date: Tue, 26 Jun 2018 00:55:55 +0300	[thread overview]
Message-ID: <3ef155eb-a465-b96b-e0b8-736db5c758a1@tarantool.org> (raw)
In-Reply-To: <4d20128b-9199-739a-83e4-3eacfa03465a@tarantool.org>


>> @@ -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

  reply	other threads:[~2018-06-25 21:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 21:43 [tarantool-patches] [PATCH 0/3][vshard] Small patches AKhatskevich
2018-06-22 21:43 ` [tarantool-patches] [PATCH 1/3] Do not force login/pass in URI AKhatskevich
2018-06-22 22:11   ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-25 21:56     ` Alex Khatskevich
2018-06-26 11:11       ` Vladislav Shpilevoy
2018-06-22 21:43 ` [tarantool-patches] [PATCH 2/3] Allow use existing user AKhatskevich
2018-06-22 22:12   ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-25 21:55     ` Alex Khatskevich [this message]
2018-06-26 11:11       ` Vladislav Shpilevoy
2018-06-22 21:43 ` [tarantool-patches] [PATCH 3/3] Introduce destroy module feature AKhatskevich
2018-06-22 22:11   ` [tarantool-patches] " Vladislav Shpilevoy
2018-06-25 21:54     ` Alex Khatskevich
2018-06-26 11:11       ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ef155eb-a465-b96b-e0b8-736db5c758a1@tarantool.org \
    --to=avkhatskevich@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH 2/3] Allow use existing user' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox