1
0
mirror of https://github.com/ansible/tower-cli.git synced 2026-02-06 00:48:50 +01:00

61 Commits

Author SHA1 Message Date
Kyle Fattig
566a91c659 Updating base list to call read for multiple pages, rather than recurse. 2019-01-24 15:18:40 -05:00
Kyle Fattig
3997c14a3c Fixed page numbering when using all-pages and format human 2019-01-16 10:57:43 -06:00
AlanCoding
1c923d3a01 copy new-name compatibility text 2018-09-13 09:26:12 -04:00
Eric Lavarde
1c23b0dcad Avoid duplicating twice the same object with same name 2018-09-10 19:21:22 +02:00
Eric Lavarde
63df311180 Avoid ignoring name provided while copying objects
Just switching two lines to first create the default name
with timestamp and then overwrite it with the CLI options.

Closes #471
2018-08-17 15:04:30 +02:00
AlanCoding
6e5bf0d8f1 fix reported problems associating labels 2018-08-15 14:48:17 -04:00
Mark Farrell
ed4f3a98ab Pass outfile to wait to ensure that all output from monitor is directed to outfile 2018-07-12 23:31:37 +00:00
Alan Rominger
71de9de667 Merge pull request #561 from willthames/monitor_outfile
Improving writing job output to files
2018-07-11 20:26:34 -04:00
Will Thames
1b46f75782 Allow stdout to write to an output file
monitor has more functionality than we need just to obtain the stdout
results, whereas outputting stdout to a file would be helpful

Better document the stdout method

Ensure tests work
2018-07-06 09:21:47 +10:00
Pierre Roux
d3f2a8ba93 Add multiple statuses processed from the list cmd
This shortcut is handled using OR queries so that it respects
the original pagination and order of objects.

To achieve that, we had to remove the limitation of passing
identical query names to the params argument of the client
and to remove the related test.
2018-07-03 17:06:41 +00:00
Will Thames
f115909a2d Ensure job output gets sent to outfile
Job output needs to be sent to outfile correctly, rather than
always stdout.
2018-06-26 17:02:41 +10:00
Pierre-Louis Bonicoli
dbd936decc Fix UnicodeDecodeError (Python 2.7 compatibility)
Using the following command:

    tower-cli job launch -J "generate random status" --monitor

exception was:

    Traceback (most recent call last):
      File "bin/tower-cli", line 11, in <module>
        load_entry_point('ansible-tower-cli', 'console_scripts', 'tower-cli')()
      File "local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
        return self.main(*args, **kwargs)
      File "local/lib/python2.7/site-packages/click/core.py", line 697, in main
        rv = self.invoke(ctx)
      File "/home/lilou/src/ansible/tower-cli.git/tower_cli/cli/base.py", line 129, in invoke
        return super(TowerCLI, self).invoke(ctx)
      File "local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
        return callback(*args, **kwargs)
      File "tower-cli/tower_cli/conf.py", line 359, in method_with_context_managed
        method(*args, **kwargs)
      File "tower-cli/tower_cli/cli/resource.py", line 107, in func
        result = method(*args, **kwargs)
      File "tower-cli/tower_cli/resources/job.py", line 248, in launch
        return self.monitor(job_id, timeout=timeout)
      File "tower-cli/tower_cli/models/base.py", line 840, in monitor
        if not six.text_type(content).startswith("Waiting for results"):
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 2296: ordinal not in range(128)

Closes #516
2018-06-04 02:34:39 +02:00
AlanCoding
f2f300b05e fix empty associate method names 2018-05-31 11:12:13 -04:00
Pierre Roux
5b080bfb8e Fix unwanted assignment in ManyToManyField
`self.method_name` was set two times in `ManyToManyField.__init__`.
Moreover, the value of `self.method_name` was always `None` before calling `_set_method_names`.
2018-05-15 09:15:49 +02:00
John Westcott IV
090da3fd3c Send/Receive feature PR
Added dependencies and related to POSSIBLE_TYPES

They are needed for the import functionality

i before e except after c

Fixed typo in receive

Added receive option

Changed classname from Destroyer to Cleaner

Added empty command

Added required=False to scm-type field.

This field is not required by the API to create a project

Removed items from export if managed_by_tower = True

Added credential_type to dependencies for a credential

This allows resoluation of a credential_type when importing a credential

Added send command

Missing __init__.py file

Added type parameter to cleaner

Send and Receive now can do json or yaml

Removed possible types, adding its items into resource objects

Changed how assets are specified for export

Added exception if nothing was passed in to process

Added all option to cleaner method

Fixed issue where properties added in the source were not caught as needed to be updated

Added send/recieve/empty docs

Updated help text for empty

Move removeEncryptedValues to common

Added deepclone of asset when determining if asset needs update

This fixed an issue when removing items in the asset that were later referenced

Fixed some issues when importing credentials

Added workflow nodes import/export

Initial commit of inventory groups/hosts/sources and fix for vault_creds in job_template

Updated API to strip off /api/vX if passed in as url

This allows you send URLs retreived from the API back into TowerCLI

Caught additional exception

If already parsed Java is passed in you could get a TypeError exception which was not caught.

Added notification types

Added workflow name to error message when extracting nodes

When this condition occurs the message is displayed but in a receive no details are present as to what workflow had the error

Added all_pages when requesting workflow_nodes

Allowed for multiple tokens to be saved in ~/.tower_cli_token.json

Added debug log if asset does not have POST options

Removed unused import and debug message

If an object does not have POST options, just return

Changed how errors are logged

Added project updates if asset was created or updated

Removed local_path from SCM based projects

Changed removal of encrypted values from asset to exported_asset

Added workflow inventory and credential resolution

Added inventory group import/export

Added additional credential types for export/import

Added options for passwords for new items

Variablized workdlow node types

Fixed workflow comparison

Spell checking

All post PR fixes for send/receive

Modified print statements for python3

Wrapped TowerCLI class in try

This should give us a better error when performing exports

Don't get source project if its None

Fixed user passwords

Moved projects before inventory

An inventory with a source from a project requires projects to be created first

Added inventory source_script resolution

Another change for comparing workflow nodes

Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit d8b0d2dbff2713a86aee4c7ca901d789b6e1d470, reversing
changes made to 87ea5d2c6118f797dd908404974e790df8e4059a.

Fixed unintended injection of documentation

Added todo

Removed comments for pull request

Removed commants on dropping format

Fixed bad merge

Updated for flake8

Added all_pages to lists

Better handeling of extra_vars

Multiple changes

Made empty take params like receive

Output of send and empty are now ansible-ish

Changed function name to python standards

Extracted 'work' into method for calling programatically

Fixed missing :

Fixed newline at end of file causing flake8 failure

removed closing #'s

Changed from passing on TypeError to continuing if not a string

Added min_value and max_value to list of known types

Changed from .prefix to .get_prefix()

Moved out touchup_extra_vars so that it applies to all asset_types

Fixed issue where tox was sending back a json_token of 'invalid' causing issues with the dict

Added missing POST endpoint

Use six for string compare
2018-03-14 13:52:04 -04:00
AlanCoding
7bc22d0c4d fix bug with bytestring operation 2018-03-12 08:30:26 -04:00
AlanCoding
0d7cff579b implement ability to do server-side copying 2017-12-20 15:01:57 -05:00
AlanCoding
58aab0af26 use field for many-to-many relationships 2017-11-06 08:36:00 -05:00
AlanCoding
86eb1ee9d9 fix copy error with extra_vars 2017-10-11 09:32:24 -04:00
Evgeni Golov
5c7d020a47 fix spelling mistakes spotted by Debian's lintian tool 2017-10-08 15:49:21 +02:00
AlanCoding
e9821d6db5 remove old version logic not needed in v2 API 2017-09-27 08:28:04 -04:00
AlanCoding
ab089566a1 Merge branch 'v1' into merge_v1 2017-09-19 13:31:02 -04:00
Alan Rominger
4a4f791669 Merge pull request #336 from AlanCoding/fix_bases
allow for multiple inheritances with click methods
2017-09-05 11:19:48 -04:00
Aaron Tan
ed57231994 Docs for Tower CLI 2017-09-01 15:22:04 -04:00
AlanCoding
b4c16b21e6 allow for multiple inheritances with click methods 2017-08-24 09:22:20 -04:00
AlanCoding
e219a7ce41 add list option for page size 2017-08-24 09:06:41 -04:00
Aaron Tan
2a6b8ddf39 Implement instance/instance_group resources 2017-07-21 16:44:35 -04:00
Aaron Tan
c1c130d0d9 Spread util code files 2017-07-06 17:22:54 -04:00
Aaron Tan
a40d0bed35 Merge pull request #306 from jangsutsr/issue300
Enhance startswith argument usage for python 3.5 compatibility
2017-07-05 12:34:14 -04:00
Aaron Tan
72cf8d4a9d Refactor to have cli directory. 2017-06-08 16:28:41 -04:00
Aaron Tan
9bbd8aad6b Enhance startswith argument usage for python 3.5 compatibility. 2017-06-07 17:22:12 -04:00
Aaron Tan
0fb7b64c91 merge utils/decorators.py into conf.py 2017-06-05 13:03:57 -04:00
Alan Rominger
8d566347f0 Merge pull request #280 from evgeni/copy-resource
implement copying of resources as in the UI
2017-03-27 13:23:56 -04:00
Evgeni Golov
b8e4257e68 implement copying of resources as in the UI 2017-03-24 17:18:08 +01:00
Alan Rominger
e35de20e63 Merge pull request #278 from evgeni/job-relaunch
implement relaunch of jobs like in the UI
2017-03-24 08:24:42 -04:00
Evgeni Golov
d58470c751 implement relaunch of jobs like in the UI 2017-03-23 14:02:49 +01:00
AlanCoding
d8a2db9de2 Fix bug where extra_vars were lost on create
moving all overwrites into write method, avoiding collisions with command structure
2017-03-21 16:55:44 -04:00
Aaron Tan
3524a16701 restore original order of adding click options 2017-03-20 11:08:54 -04:00
Aaron Tan
147c7f578a Merge pull request #270 from jangsutsr/issue269
Use safer format indicator across base.py
2017-03-13 12:31:09 -04:00
Aaron Tan
a995e5a08e Use safer format indicator across base.py. 2017-03-13 12:17:00 -04:00
AlanCoding
03262ea28c change the ordering in which runtime config vars are processed 2017-03-09 12:43:03 -05:00
Alan Rominger
6e5d8eaf5e Merge pull request #258 from AlanCoding/workflow_job_monitor
Workflow job summary and monitor
2017-03-08 15:17:28 -05:00
Aaron Tan
031dcf5886 Merge pull request #263 from jangsutsr/issue256
Resolve issue256
2017-03-08 14:16:09 -05:00
Aaron Tan
940e9c5e9b Refactor based on review feedback. 2017-03-08 14:01:21 -05:00
AlanCoding
b980c0203b SurveyMixin introduced to manage workflow surveys 2017-03-08 10:50:47 -05:00
Alan Rominger
9163057f4e Merge branch 'master' into workflow_job_monitor 2017-03-08 10:43:21 -05:00
Alan Rominger
6164521e8d Merge pull request #220 from AlanCoding/stdm3
Introduce Standard Out Streaming with wait as old monitoring
2017-03-08 10:40:55 -05:00
Aaron Tan
dff05d30f8 Resolve a rare corner case when creating a dependent resource with --force-on-exists is on. 2017-03-07 16:27:41 -05:00
Ryan Petrello
c5d246a1bf Merge pull request #252 from ryanpetrello/settings-cli
support listing, retrieving, and updating Configure Tower in Tower setting values
2017-03-06 16:49:59 -05:00
AlanCoding
731dc68e3a Refactor of workflow job streaming in response to PR feedback
call method "summary"
 make use of standard human formatter
 completely swap out and replace stdout method
2017-03-06 12:03:30 -05:00