Commit Graph

42 Commits

Author SHA1 Message Date
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
Wayne Witzel III
4b5b56c284 Fixing test fallout from InventorySource model change 2017-04-11 14:04:25 -04:00
Ryan Petrello
95ea370e5e add API versioning for /api/v2/ 2017-03-30 15:11:12 -04:00
Ryan Petrello
f4d4c43d94 prohibit order_by= for sensitive fields
see: #5526
2017-03-10 08:49:59 -05:00
Aaron Tan
9e4655419e Fix flake8 E302 errors. 2016-11-15 20:59:39 -05:00
Akita Noek
b21c7e1d15 Fix inventory update permission so update_role is enough to update 2016-06-30 14:58:44 -04:00
Akita Noek
291c8126d7 Fixed inventory edit editablity from update_role users
Now you'll need the expected admin_role access to do things like edit
inventory, groups, and hosts.

 Resolves #2561
2016-06-24 11:03:54 -04:00