Uploaded image for project: 'Automation Hub'
  1. Automation Hub
  2. AAH-1191

galaxykit user create: support extra fields

    • Icon: Task Task
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • None
    • UI
    • None
    • 4.5.0a Sprint 5, 4.5.0 Sprint 6, 4.5.0 Sprint 7

      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.

              semighdo@redhat.com Shaiah Emigh-Doyle
              mhradil-1 Martin Hradil
              Henderson Hummel Henderson Hummel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: