250 Commits

Author SHA1 Message Date
Jeff Bradberry
dfe34563aa Resolve the natural keys of assets we've already collected 2020-06-09 13:54:04 -04:00
Jeff Bradberry
37cbf7691b Split out separate methods for the OPTIONS call and massaging each asset dict 2020-06-09 13:54:04 -04:00
Jeff Bradberry
9280198b0f Use a list of exportable resources to build up the parser
Also, handle an implicit export of everything.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
2127f3c96d Add organizations as a resource type to export 2020-06-09 13:54:04 -04:00
Jeff Bradberry
9f7fecf8da Add basic import command 2020-06-09 13:54:04 -04:00
Jeff Bradberry
c1a07ff00b Limit export output to only those fields needed to create the resource 2020-06-09 13:54:04 -04:00
Jeff Bradberry
f21d6b1fc4 Actually query the API for the user or users requested 2020-06-09 13:54:04 -04:00
Jeff Bradberry
4312395a3a Normalize the requested resource into a pk
using the pk_or_name helper function.  Also, authenticate to the API.
2020-06-09 13:54:04 -04:00
Jeff Bradberry
c1f6fec532 Add skeleton of a custom 'export' resource
This only takes a flag for users at the moment, and does nothing in
particular with it.
2020-06-09 13:54:04 -04:00
Shane McDonald
2bbbb04499
Bump version to 12.0.0 2020-06-09 12:19:17 -04:00
Ryan Petrello
0c6b7fdb59
don't use symlinks for awxkit VERSION
as much as I'd like this to just work, certain versions of pip just
don't support it -_-

see: https://github.com/ansible/awx/issues/7107
see: https://github.com/pypa/pip/issues/7555

so unfortunately, we just have to track these as two distinct files and
just keep them in sync
2020-05-21 12:10:33 -04:00
Ryan Petrello
18607107a7
remove the deprecated extra_credentials endpoints 2020-04-30 10:22:02 -04:00
Elyézer Rezende
5c91f66316
Keep awxkit's requirements on the setup.py
awxkit's setup.py was making use of pip internal structures to parse the
requirements.txt file. This is not a good thing as they may change,
actually that just happened.

To avoid this in the future, move the list of requirements to setup.py
and make requirements.txt list `.` as the only item. This way we keep a
single place to update requirements in the future and avoid accessing
pip's internals.
2020-04-29 14:47:21 -04:00
Francois Herbert
d0384799fd
Add ability to monitor jobs and workflow_jobs via awx cli, fixes #6165
Signed-off-by: Francois Herbert <francois@herbert.org.nz>

Fixup linting

Remove timeout option, not really required and it's making the api test fail
2020-04-27 15:09:16 -04:00
Christian Adams
a899a147e1 Fix new flake8 from pyflakes 2.2.0 release 2020-04-20 09:50:50 -04:00
AlanCoding
b90a296d41
Document and align the env var for OAuth token 2020-04-07 10:00:02 -04:00
Elijah DeLee
8e07269738 make awxkit pass through identifier for wfjtn
We need this to be able to create workflow job template nodes with identifier
2020-04-06 11:26:56 -04:00
Ryan Petrello
32627ce51a
promote AWX CLI installation instructions to the global INSTALL.md
a few users have had trouble finding these instructions, so let's move
them into the top level installation docs
2020-03-30 11:46:10 -04:00
Ryan Petrello
ea54815e6b
fix a bug that broke awx config
see: https://github.com/ansible/tower/issues/4206
2020-03-27 17:07:48 -04:00
softwarefactory-project-zuul[bot]
ee4dcd2055
Merge pull request #6403 from jbradberry/awxkit-from-json-connection
Add a connection kwarg to Page.from_json

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-03-25 15:33:37 +00:00
softwarefactory-project-zuul[bot]
0f7a4b384b
Merge pull request #6386 from jbradberry/awxkit-api-endpoints
Awxkit api endpoints

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-03-25 15:33:32 +00:00
Jeff Bradberry
91135f638f Add a connection kwarg to Page.from_json
if you don't reuse the connection when doing this, you lose your
authentication.
2020-03-24 15:27:51 -04:00
AlanCoding
5e595caf5e
Add workflow node identifier
Generate new modules WFJT and WFJT node
Touch up generated syntax, test new modules

Add utility method in awxkit

Fix some issues with non-name identifier in
  AWX collection module_utils

Update workflow docs for workflow node identifier

Test and fix WFJT modules survey_spec
Plug in survey spec for the new module
Handle survey spec idempotency and test

add associations for node connections
Handle node credential prompts as well

Add indexes for new identifier field

Test with unicode dragon in name
2020-03-23 22:00:00 -04:00
Jeff Bradberry
e3ea4e2398 Register the resource copy endpoints as awxkit page types 2020-03-23 15:19:48 -04:00
Jeff Bradberry
e4e2d48f53 Register some missing related endpoints in awxkit
- the newer varieties of notification templates
- organization workflow job templates
- credential owner users and owner teams

this allows the endpoints to get wrapped in appropriate Page types,
not just the Base page type.
2020-03-23 15:18:47 -04:00
Ryan Petrello
06b3e54fb1
remove python2 support from awxkit 2020-03-19 09:02:39 -04:00
chris meyers
59c9de2761
awxkit python2.7 compatible print
* awxkit still supports python2.7 so do not use fancy f"" yet; instead,
use .format()
2020-03-18 16:10:20 -04:00
chris meyers
093d204d19
fix flake8 2020-03-18 16:10:19 -04:00
chris meyers
14320bc8e6
handle websocket unsubscribe
* Do not return from blocking unsubscribe until _after_ putting the
gotten unsubscribe message on the queue so that it can be read by the
thread of execution that was unblocked.
2020-03-18 16:10:18 -04:00
chris meyers
3f2d757f4e
update awxkit to use new unsubscribe event
* Instead of waiting an arbitrary number of seconds. We can now wait the
exact amount of time needed to KNOW that we are unsubscribed. This
changeset takes advantage of the new subscribe reply semantic.
2020-03-18 16:10:16 -04:00
Christian Adams
4a0c371014 Fix flaky workflow test & set junit family 2020-03-18 14:02:33 -04:00
softwarefactory-project-zuul[bot]
98dc6179f5
Merge pull request #5919 from AlanCoding/good_projects
Fail early processing project factory

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-03-02 18:41:47 +00:00
Ryan Petrello
3e0e4b6c8f
cli: add the ability to specify a token description w/ awx login
see: https://github.com/ansible/awx/issues/6122
2020-02-28 11:12:26 -05:00
AlanCoding
c5079607aa
Fail early processing project factory 2020-02-26 14:21:38 -05:00
Ryan Petrello
946d643795
cli: make launch with --monitor return code respect the final job status
see: https://github.com/ansible/awx/issues/5920
see: https://github.com/ansible/awx/issues/6079
2020-02-26 12:27:06 -05:00
Yanis Guenane
07232f3694 awx-api-lint: Fix setup.cfg syntax for linter test
Signed-off-by: Yanis Guenane <yguenane@redhat.com>
2020-02-26 11:07:46 +01:00
softwarefactory-project-zuul[bot]
4c40819791
Merge pull request #5965 from benthomasson/improve_awx_kit_error_message
Works around bad error message when authentication fails

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-02-25 23:16:58 +00:00
Bill Nottingham
341c6ae767 Also remove some dangling rax from awxkit and collection modules. 2020-02-25 15:18:26 -05:00
nixocio
da486d7788 Add test method to Credential and CredentialType - awxkit
Add test method to Credential and CredentialTypei - awxkit.

The inclusion of this one was discovered when testing the following
issue. https://github.com/ansible/awx/issues/5141
2020-02-18 14:44:16 -05:00
Ben Thomasson
0c0cacb0d6 Works around bad error message when authentication fails
related #5964
2020-02-17 15:59:05 -05:00
AlanCoding
3172176940
By default, give status code in exception representation 2020-02-11 13:08:20 -05:00
Apurva Bakshi
2de37ce5df add convergence attribute to awxkit 2020-02-05 14:28:35 -05:00
Rebeccah
780f104ab2 shifted from dependants/dependencies to children/parents for clarity in function names, also added in toggle logic 2020-02-05 14:28:34 -05:00
Rebeccah
cf24c81b3e updated syntax from python2 to 3 2020-02-05 14:28:34 -05:00
Ryan Petrello
1800b49822
fix a py2/py3 compat bug in the settings CLI 2020-02-03 11:37:39 -05:00
Hideki Saito
437d9843d1 Fix to handle Str and JSON mix-in data correctly with settings API
- Fixed issue #5528

Signed-off-by: Hideki Saito <saito@fgrep.org>
2020-01-28 11:51:35 -05:00
Elijah DeLee
2a77b8b4b9 Fix overzealous cleanup in awxkit
Introduced this problem with 1e796076f55f81a3cc7864efeb03db3b03312112
2020-01-22 10:23:40 -05:00
Elijah DeLee
1e796076f5 Scan jobs have been removed, clean up old refs
see https://github.com/ansible/awx/issues/5603
2020-01-21 12:11:53 -05:00
Elijah DeLee
d82180605c Raise a more informative error when timeout
Right now we are often left with very little info if we do get a timeout on something that HasStatus.

Take advantage of the assert_status function that is also available on items using the HasStatus mixin to show
more info.
2020-01-08 12:47:17 -05:00
Bill Nottingham
ac9bf1afcf Don't error on a trailing slash, just fix it up 2019-12-13 15:59:40 -05:00