]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: make radosgw-admin user create and modify distinct 31901/head
authorMatthew Oliver <moliver@suse.com>
Fri, 10 Jan 2020 03:17:11 +0000 (03:17 +0000)
committerMatthew Oliver <moliver@suse.com>
Mon, 17 Feb 2020 04:07:40 +0000 (04:07 +0000)
commit269e9b9d3c81aa8a9831f9d60429bb913a63eff0
tree1d1fc715bb028676e260fd38cbf7db28b1c50638
parent6adcace69498f6ae597fb4a83a221dd0cf3af8bd
rgw: make radosgw-admin user create and modify distinct

Currently if you run 'radosgw-admin user create ..' when the user
already exists and you happen to specify, at least,  '--uid' and
'--display-name' that match the existing user, radowgw-admin will
actaully go modify the existing user.

This behaviour is a little confusing, hence the bug this patch is
fixing. This patch instead simplifies the tool to make
'create' create and 'modify' modify.
Meaning when you go 'create' a user that already exists, you'll get an
error, as expected. If you want to modify a user, you actually have to
use 'modify'.

For exapmle, now:

  $ radosgw-admin user create --uid="test-user"  --display-name="test user"
  could not create user: unable to create user, user: test-user exists

Signed-off-by: Matthew Oliver <moliver@suse.com>
Fixes: https://tracker.ceph.com/issues/38619
src/rgw/rgw_user.cc