Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.

Conversation

@redixin
Copy link
Contributor

@redixin redixin commented Mar 13, 2017

Currently only AWS account is possible to create via CLI.

This patch adds support of discovering available account types and creating CLI subcommands for each account type.

E.g. if we have AWS and OpenStack account types available we will have two additional subcommands:

usage: manage.py [-h]
...
    add_account_aws     Add AWS account
    add_account_openstack
                        Add OpenStack account
...

Sample of custom account usage:

$ manage.py add_account_openstack -h
usage: manage.py add_account_openstack [-h] -n NAME [--thirdparty] [--active]
                                       [--notes NOTES] --id IDENTIFIER
                                       [--auth_url AUTH_URL]
                                       [--username USERNAME]
                                       [--password PASSWORD]
                                       [--project_name PROJECT_NAME]
                                       [--project_domain_name PROJECT_DOMAIN_NAME]
                                       [--user_domain_name USER_DOMAIN_NAME]

Add OpenStack account

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME
  --thirdparty
  --active
  --notes NOTES
  --id IDENTIFIER
  --auth_url AUTH_URL
  --username USERNAME
  --password PASSWORD
  --project_name PROJECT_NAME
  --project_domain_name PROJECT_DOMAIN_NAME
  --user_domain_name USER_DOMAIN_NAME

Sample of AWS account usage:

usage: manage.py add_account_aws [-h] -n NAME [--thirdparty] [--active]
                                 [--notes NOTES] --id IDENTIFIER
                                 [--s3_name S3_NAME] [--role_name ROLE_NAME]

Add AWS account

optional arguments:
  -h, --help            show this help message and exit
  -n NAME, --name NAME
  --thirdparty
  --active
  --notes NOTES
  --id IDENTIFIER
  --s3_name S3_NAME
  --role_name ROLE_NAME

@coveralls
Copy link

Coverage Status

Coverage remained the same at 56.62% when pulling 790f5d2 on redixin:add_custom_account into 85d3dbb on Netflix:develop.

@scriptsrc
Copy link
Contributor

That's pretty cool.

@redixin
Copy link
Contributor Author

redixin commented Mar 14, 2017

@MonkeySecurity I have just few questions:

  • how to deal with current add_account subcommand? The simplest way is to hide add_account_aws and show only custom accounts.
  • should I write unit tests for new code?

@scriptsrc
Copy link
Contributor

I'm okay with deprecating the current add_account command. I'll put a note in the next release that add_account has been replaced with add_account_aws.

None of the other manage.py commands have unittests. The Account Registry you're calling out to likely is covered.

I'm going to merge and then add a commit to remove add_account.

@scriptsrc
Copy link
Contributor

(Merging now because this is now a dependency of my new quickstart guide.)

@scriptsrc scriptsrc merged commit 6a817d0 into Netflix:develop Mar 15, 2017
@redixin redixin deleted the add_custom_account branch March 15, 2017 09:11
This was referenced Apr 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants