Hi Gautam, Sorry for late response. The function riak_cs_user:create_user() should be executed on riak cs node. If you want to call it by escript, you can use rpc:call to execute it.
Shino On Sat, Sep 19, 2015 at 7:43 AM, Gautam Pulla <gautam.pu...@thetradedesk.com> wrote: > Hello, > > > > I’d like to create a riak-cs user with a pre-set key/secret and am following > the workaround from https://github.com/basho/riak_cs/issues/565. This is > works when I type it into the interactive riak-cs console, however I want to > script this in a non-interactive fashion. > > > > I’ve created a small erlang script and am using riak-cs escript to run it (I > don’t know erlang at all so there are probably basic errors). > > > > This is what I get when I run the script: > > > > # riak-cs escript /tmp/createuser.erl > > {error,admin_key_undefined} > > > > Here is my script: > > > > # cat /tmp/createuser.erl > > #!/usr/bin/env escript > > -import(riak_cs_user, [create_user/4]). > > > > main(_) -> > > R = riak_cs_user:create_user("test", "t...@ttd.com", "blah", "foo"), > > Rs=lists:flatten(io_lib:format("~p", [R])), > > io:format(Rs), > > io:format("\n"). > > > > Any pointers? > > > > Thanks! > > Gautam > > > _______________________________________________ > riak-users mailing list > riak-users@lists.basho.com > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > _______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com