Commit Graph

56 Commits

Author SHA1 Message Date
Seth Foster
0522233892 remove update_on_project_update from InventorySource 2022-06-24 15:27:08 -04:00
Rebeccah
44cc934c2b add projects to test that ordering functions correctly and when it gets a value it cannot order by it falls back to ID
add tests that check ordering for projects, organizations, inventories, groups, and hosts
2022-04-08 17:18:57 -04:00
Bill Nottingham
1e68519c99 Remove insights_credential from inventory 2021-06-22 10:49:33 -04:00
Alan Rominger
a54aab9717 Remove old uses of CustomInventoryScript
some uses are minor references

Fix some test fails
2021-04-22 08:36:48 -04:00
Alan Rominger
38352063e8 Remove custom inventory script API 2021-04-22 08:36:46 -04:00
Ryan Petrello
c2ef0a6500 move code linting to a stricter pep8-esque auto-formatting tool, black 2021-03-23 09:39:58 -04:00
Chris Meyers
48fb1e973c overwrite plugin: at runtime
* Before, we were re-writing `plugin:` when users updated the
InventorySource via the API. Now, we just override at run-time. This
makes for a more sane API interaction
2020-09-01 12:50:58 -04:00
Chris Meyers
b7efad5640 do not enforce plugin: for source=scm
* InventorySource w/ source type scm point to an inventory file via
source_file. source_vars are ignored.
2020-09-01 12:50:57 -04:00
Chris Meyers
34adbe6028 fix tests for new inv plugin behavior
* Enforce plugin:
2020-09-01 12:50:57 -04:00
softwarefactory-project-zuul[bot]
d8f6ea3fe8 Merge pull request #7485 from ryanpetrello/words-matter
replace certain terms with more inclusive language

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
2020-06-30 17:00:58 +00:00
Ryan Petrello
78229f5871 replace certain terms with more inclusive language
see: https://www.redhat.com/en/blog/making-open-source-more-inclusive-eradicating-problematic-language
2020-06-30 10:49:19 -04:00
Jake Jackson
30757f8289 moved logic to the validate function and fixed tests accordingly 2020-06-26 15:04:48 -04:00
Jake Jackson
606d4e0ea2 added change so that groups and host names cannot share the same name in the same inventory. added tests to validate 2020-06-25 11:25:21 -04:00
Alan Rominger
768280c9ba [last PR stuff] + Add warning if configs specified in 2 params (#5)
* Lean on API validation for tower_inventory_source arg errors

used for
 - validating needed credential is given
 - missing source_project for scm sources

* Add warning when config is specified in 2 places

Fix up unit tests, address multiple comments re: backwards compatibility, redundant methods, etc.

Update new_name and variables parameters, update unit tests
2020-02-26 09:26:55 -05:00
Ryan Petrello
4e6b0e1580 clean up old v2 versioning in API tests 2019-08-22 15:14:06 -04:00
beeankha
17c89ed412 Remove tests for 'any' notification state 2019-06-17 10:47:58 -04:00
beeankha
f5b6bd65cf More deletions of 'any' state 2019-06-17 10:47:58 -04:00
beeankha
c6f1806a23 Removing references to 'any' state notifications 2019-06-17 10:47:58 -04:00
AlanCoding
231abf865b put variable data permission in its own class 2019-05-08 13:43:13 -04:00
Jeff Bradberry
60008dbd74 Add a test that AWX doesn't care about max_hosts when editing hosts
on an inventory.
2019-02-28 15:54:09 -05:00
Jeff Bradberry
4afd0672a1 Add test that AWX doesn't care about the limit when creating new hosts 2019-02-28 15:54:09 -05:00
Ryan Petrello
bb5312f4fc prevent field lookups on Host.ansible_facts keys (it doesn't work)
under the hood, Host.ansible_facts is a postgres jsonb field which
performs match operations using the JSON containment operator (@>)

this operator _only_ works on exact matches on containment (i.e.,
"does the `ansible_distribution` jsonb value contain _this exact_ JSON
structure"):

SELECT ...
FROM main_host
WHERE ansible_facts @> '{"ansible_distribution": "centos"}'

SELECT ...
FROM main_host
WHERE ansible_facts @> '{"packages": {"dnsmasq": [{"version": 2}]}}'

postgres does _not_ expose any operator for fuzzy or lookup-based
matches with this operator, so host filter values like these don't
really make sense (postgres can't _filter_ in the way intended in these
examples):

ansible_distribution__startswith=\"Cent\"
ansible_distribution__icontains=\"CentOS\"
ansible_facts__packages__dnsmasq[]__version__startswith=\"2\"
2019-02-05 10:43:51 -05:00
Ryan Petrello
f223df303f convert py2 -> py3 2019-01-15 14:09:01 -05:00
AlanCoding
9a85578925 move inv src vault cred validation from view to model 2018-08-20 08:53:55 -04:00
Yunfan Zhang
270102c188 Forbid users from using unauthorized credentials in projects and inventories.
Signed-off-by: Yunfan Zhang <yz322@duke.edu>
2018-07-09 15:04:53 -04:00
AlanCoding
6306ac2825 use field validation in both filter classes 2018-04-26 07:23:20 -04:00
AlanCoding
018514d657 urlencode unquote host_filter on save 2017-10-24 08:05:08 -04:00
Wayne Witzel III
ca9a1a0ca1 remove tests that execute distinct logic, sqlite3 does not support 2017-08-21 06:16:44 -04:00
AlanCoding
5f4d033836 change test to match with recent error message change 2017-08-08 13:57:51 -04:00
Chris Meyers
8574c6ef4a Merge pull request #180 from chrismeyersfsu/fix-7383
fix single update_on_project_update per-inventory
2017-08-07 10:57:01 -04:00
Chris Meyers
95c12ac1ab enforce muutally exclusivity on update_on_project_update and update_on_launch for scm inventory 2017-08-07 10:50:36 -04:00
Aaron Tan
bba1e46218 Move inventory delete activity stream into view 2017-08-04 10:37:34 -04:00
Chris Meyers
22aa251a24 Merge pull request #127 from chrismeyersfsu/fix-6559
remove conditional inventory sources POST
2017-08-02 12:25:50 -04:00
Chris Meyers
6cc5f14e16 remove conditional inventory sources POST
* Move logic from validator down to model
* Allow only 1 inventory source of type scm with
update_on_project_update set to True; for each inventory
2017-08-02 11:49:10 -04:00
Aaron Tan
cc481aa33b Clear related job templates when inventory is deleted 2017-07-31 13:47:58 -04:00
adamscmRH
3dcd6ef2c2 Blocks creation of Hosts, Groups, and IS for Smart Inventories
* Updated View unit tests

* Refactored Validators

* Validator Fix for Blocking
2017-07-28 16:24:09 -04:00
AlanCoding
cc547af18b on initial SCM inv src creation update, dont update project rev 2017-07-24 15:12:16 -04:00
AlanCoding
f2d51f99dc Allow manual updates in spite of update_on_project_update
This makes inventory sources with the that flag set behave
like any other inventory source with manual use.
They will still update when triggered by a project SCM
hash change.
2017-07-20 09:38:47 -04:00
AlanCoding
2c81a2489e prohibit direct creation of manual inventory sources 2017-07-12 12:29:56 -04:00
Aaron Tan
97e0835d1c Release unified UJT unique_together constraint. 2017-07-06 09:44:34 -04:00
Alan Rominger
68103f2d72 Merge pull request #6720 from AlanCoding/scm_inv_update_resp
Accuracy edit for inventory update response when updating project
2017-06-29 11:45:50 -04:00
Wayne Witzel III
ad95917db6 fix tests 2017-06-29 08:00:13 -04:00
AlanCoding
4298d60679 fix bug in response of inventory update with update_on_project_update 2017-06-26 09:48:01 -04:00
AlanCoding
066dc4a5f0 Separate Inventory Source API vs RBAC testing
Introduced new decorator for patching an access method,
does legwork of inserting into access registry so that
tests that test the API can mock RBAC behavior.
2017-06-23 15:31:59 -04:00
Ryan Petrello
97562fc4df block job template launches when an inventory is being deleted
see: #4382
2017-06-22 15:33:55 -04:00
Chris Meyers
87eea59845 add per-inventory insights credential 2017-05-26 07:25:36 -04:00
AlanCoding
97ca6bc897 SCM inventory acceptance and bug updates
* fixed a problem where the SCM last revision was not getting reset
* change the 400 editing error to just reset the last revision
* handle `source_vars` in the same way as custom scripts
* block unallowed `source_vars` in the validator
* hide POST in OPTIONS for inventory source sublist if not allowed
2017-05-11 12:04:48 -04:00
AlanCoding
d826c45ac6 SCM Inventory field name changes
on InventorySource model
* scm_project -> source_project
on InventorySourceSerializer
* scm_inventories -> scm_inventory_sources

on InventoryUpdate model
* scm_project_update -> source_project_update
2017-05-04 09:15:29 -04:00
AlanCoding
8d2598beee allow management of 2 types of SCM inventory sources 2017-05-03 12:18:08 -04:00
Wayne Witzel III
7458788562 More updates for InventorySource changes 2017-04-11 14:04:25 -04:00