-
Task
-
Resolution: Done
-
Normal
-
None
-
None
-
None
galaxykit CLI already supports `user create <name> <password>`, but the command does not accept any further params
implement support for more fields, without relying on too many positional arguments
(bad: `user create joe s3cr3t Joe Smith '' False`
good: `user create joe s3cret --first_name=Joe --last_name Smith`)
the db field names are `email`, `first_name`, `groups`, `is_superuser`, `last_name`
I suggest using these same names for new optional arguments
(`is_superuser` should default to false unless provided)
(feel free to ignore `groups` as we already have `user group add <user> <group>`)
(the repo is https://github.com/ansible/galaxykit , `pip install -e .` in that repo should ensure calling `galaxykit` runs the development version; `command.py` handles CLI parsing, then there are individual py files for each kind/model)
(ArgumentParser is already used for some params in `main`, I believe it can be reused in the subcommand to parse the rest)
One more bit I think we should attach to this:
other galaxykit commands cause the galaxykit command to fail when they fail, but user create only prints a message. I suggest adding a `sys.exit` with a non-zero return value when failing to create the user, unless `args.ignore` is set.