Commit Graph

139 Commits

Author SHA1 Message Date
Ryan Petrello
f28f7c6184 refactor job event signal generation code 2018-01-04 12:50:12 -05:00
Ryan Petrello
1369f72885 add new API endpoints and websocket emit for new job event types
see: https://github.com/ansible/awx/issues/200
2018-01-03 09:09:44 -05:00
Matthew Jones
9dbcc5934e Merge remote-tracking branch 'tower/release_3.2.2' into devel 2017-12-13 12:25:47 -05:00
Ryan Petrello
ce94ba4c83 change how we detect the current user to avoid a nuanced recursion error
see: https://github.com/ansible/ansible-tower/issues/7802
2017-12-08 15:35:47 -05:00
Ryan Petrello
1fb890f4eb fix a race condition in "host.last_job" when jobs are deleted
see: https://github.com/ansible/ansible-tower/issues/7815
2017-12-06 11:30:19 -05:00
Chris Meyers
e19a57c50a add job event replay awx-manage command
* awx-manage replay_job_event --job_id <id>
2017-10-12 09:40:30 -04:00
Aaron Tan
a11e33458f Include Tower configurations into activity stream
Relates #7386 of ansible-tower.

Due to the uniqueness of Tower configuration datastore model, it is not
fully compatible with activity stream workflow. This PR introduced
setting field for activitystream model along with other changes to make
Tower configuration a special case for activity streams.

Signed-off-by: Aaron Tan <jangsutsr@gmail.com>
2017-10-10 14:38:45 -04:00
Ryan Petrello
6a4b4edea3 properly detect deferred ORM objects 2017-09-18 09:08:53 -04:00
Matthew Jones
ebbd42322d Fix an issue with hasattr call 2017-09-18 09:08:44 -04:00
Matthew Jones
8091b84344 Fixing up some activity stream deferreds 2017-09-18 09:08:30 -04:00
AlanCoding
50ff18ba25 avoid every-request user signals 2017-08-24 11:20:39 -04:00
Aaron Tan
bba1e46218 Move inventory delete activity stream into view 2017-08-04 10:37:34 -04:00
AlanCoding
f794472b3d fix bug introduced with anon user activity stream entries 2017-08-01 10:43:49 -04:00
AlanCoding
55cc23a712 impersonate requesting user in inventory deletion task 2017-07-31 16:06:36 -04:00
Wayne Witzel III
e84ecabe72 add schedule_deletion method and signal 2017-06-29 00:15:11 -04:00
AlanCoding
6d92c56da5 SCM Inventory model, view, and task system changes
Inventory source file-type combined with a linked project
will allow the inventory source to be updated when the
project is updated. The inventory update runs in the
post-run hook of the project update.
2017-04-17 15:01:19 -04:00
AlanCoding
7223177684 Group serializer special v1 functionality
Returns a related `inventory_source` and related link for groups
if accessed from /api/v1/, but not for API v2.
Also inserts corresponding fields to inventory source serializer.
Keep migrated manual sources and auto-create in API v1.
2017-04-17 10:30:07 -04:00
Wayne Witzel III
91f3e665cb group -> deprecated_group, added migrations, added/removed tests 2017-04-11 14:09:04 -04:00
Wayne Witzel III
c784c96449 Initial removal of InventorySource.group 2017-04-11 14:04:25 -04:00
AlanCoding
169384ddbe Start RBAC unit testing system to test is_implicit_parent 2017-03-23 15:57:50 -04:00
AlanCoding
bb292f817b move check for implicit parent role into fields.py 2017-03-22 16:30:15 -04:00
AlanCoding
b01b12ab2a avoid multi-field implicit role activity stream entries 2017-03-22 15:22:48 -04:00
Alan Rominger
711bee9633 Merge pull request #5414 from AlanCoding/manage_context
Disable activity stream in cleanup_jobs, test things
2017-02-21 12:20:34 -05:00
AlanCoding
9e363d82d8 disable activity stream in cleanup_jobs and test context managers 2017-02-16 14:09:48 -05:00
AlanCoding
d67dadd649 avoid activity stream entries of singleton implicit role associations 2017-02-16 10:22:21 -05:00
Chris Church
1db697e4eb Add multiprocessing RLock around event data output to ensure only one process is writing to stdout at a time. 2016-11-17 09:09:19 -05:00
Aaron Tan
2d1a5425d1 Fix flake8 E302 errors second round. 2016-11-16 09:56:07 -05:00
Aaron Tan
9e4655419e Fix flake8 E302 errors. 2016-11-15 20:59:39 -05:00
Aaron Tan
473ed016de Fix flake8 E305 errors. 2016-11-15 16:32:27 -05:00
Wayne Witzel III
530a5c0c88 merging devel 2016-10-03 10:35:50 -04:00
Wayne Witzel III
5faa21b72d add group_name to channel data 2016-09-27 18:39:14 -04:00
Wayne Witzel III
4c8aaf1aed converting from socketio to channels websocket 2016-09-27 18:39:07 -04:00
Chris Church
6ebe45b1bd Configure Tower in Tower:
* Add separate Django app for configuration: awx.conf.
* Migrate from existing main.TowerSettings model to conf.Setting.
* Add settings wrapper to allow get/set/del via django.conf.settings.
* Update existing references to tower_settings to use django.conf.settings.
* Add a settings registry to allow for each Django app to register configurable settings.
* Support setting validation and conversion using Django REST Framework fields.
* Add /api/v1/settings/ to display a list of setting categories.
* Add /api/v1/settings/<slug>/ to display all settings in a category as a single object.
* Allow PUT/PATCH to update setting singleton, DELETE to reset to defaults.
* Add "all" category to display all settings across categories.
* Add "changed" category to display only settings configured in the database.
* Support per-user settings via "user" category (/api/v1/settings/user/).
* Support defaults for user settings via "user-defaults" category (/api/v1/settings/user-defaults/).
* Update serializer metadata to support category, category_slug and placeholder on OPTIONS responses.
* Update serializer metadata to handle child fields of a list/dict.
* Hide raw data form in browsable API for OPTIONS and DELETE.
* Combine existing licensing code into single "TaskEnhancer" class.
* Move license helper functions from awx.api.license into awx.conf.license.
* Update /api/v1/config/ to read/verify/update license using TaskEnhancer and settings wrapper.
* Add support for caching settings accessed via settings wrapper.
* Invalidate cached settings when Setting model changes or is deleted.
* Preload all database settings into cache on first access via settings wrapper.
* Add support for read-only settings than can update their value depending on other settings.
* Use setting_changed signal whenever a setting changes.
* Register configurable authentication, jobs, system and ui settings.
* Register configurable LDAP, RADIUS and social auth settings.
* Add custom fields and validators for URL, LDAP, RADIUS and social auth settings.
* Rewrite existing validator for Credential ssh_private_key to support validating private keys, certs or combinations of both.
* Get all unit/functional tests working with above changes.
* Add "migrate_to_database_settings" command to determine settings to be migrated into the database and comment them out when set in Python settings files.
* Add support for migrating license key from file to database.
* Remove database-configuable settings from local_settings.py example files.
* Update setup role to no longer install files for database-configurable settings.

f 94ff6ee More settings work.
f af4c4e0 Even more db settings stuff.
f 96ea9c0 More settings, attempt at singleton serializer for settings.
f 937c760 More work on singleton/category views in API, add code to comment out settings in Python files, work on command to migrate settings to database.
f 425b0d3 Minor fixes for sprint demo.
f ea402a4 Add support for read-only settings, cleanup license engine, get license support working with DB settings.
f ec289e4 Rename migration, minor fixmes, update setup role.
f 603640b Rewrite key/cert validator, finish adding social auth fields, hook up signals for setting_changed, use None to imply a setting is not set.
f 67d1b5a Get functional/unit tests passing.
f 2919b62 Flake8 fixes.
f e62f421 Add redbaron to requirements, get file to database migration working (except for license).
f c564508 Add support for migrating license file.
f 982f767 Add support for regex in social map fields.
2016-09-26 22:14:47 -04:00
Wayne Witzel III
f7e9d07dad ensure CustomInventoryScripts render correctly in the ActivityStream 2016-07-11 15:25:35 -04:00
Matthew Jones
ae9b4d3e58 Revert "Fix up hook conditions for rbac activity stream"
This reverts commit 36c14f83bcb11fcdbd31140ce182ab87e3db4644.
2016-07-08 13:13:22 -04:00
Matthew Jones
1c860b81ac Fix up hook conditions for rbac activity stream 2016-07-08 13:03:34 -04:00
Matthew Jones
4c7f54cf72 Fix an activity stream associate with deleted obj
In some scenarios the activity stream associate could be invoked where
obj2 doesn't exist... the .get() will fail and tank the caller
preventing the save.   This guards that and blocks the activity stream
event, saving the save (whew!)
2016-07-08 12:56:52 -04:00
Akita Noek
5ed36624a3 Merge pull request #2664 from anoek/todo-cleanup
API todo/fixme addressing and cleanup
2016-06-28 11:01:41 -04:00
Wayne Witzel III
5456b209ac Merge pull request #2654 from wwitzel3/issue-2485
reduce activity stream noise
2016-06-27 15:47:59 -04:00
Akita Noek
831c4c2fef Cleaned up some more stale TODO's and FIXME's (or did / fixed the things) 2016-06-27 15:12:37 -04:00
Wayne Witzel III
3697ddc2d0 fixing Role is None exception 2016-06-27 13:40:50 -04:00
Wayne Witzel III
e1853372f7 Adding comments to signals for rbac activity stream 2016-06-27 11:41:00 -04:00
Wayne Witzel III
5e2a3b3ef2 reduce activity stream noise by not including implicit role dis/associations 2016-06-27 11:28:06 -04:00
Akita Noek
198daf762e Don't update computed fields while mass group deleting until the end
Significantly reduces the time it takes to delete bulk groups, re #2515
2016-06-24 15:28:49 -04:00
Matthew Jones
288ecc1c5b Ignore management jobs on activity stream 2016-06-23 16:14:56 -04:00
Matthew Jones
9e56913893 Capture some change info in activity stream for associate/disassociate events 2016-06-13 12:41:50 -04:00
Wayne Witzel III
db16478830 only special case team when sender is Role_parents 2016-06-10 17:27:11 -04:00
Wayne Witzel III
00698b82fc fix issue with Team.roles and ActivityStream 2016-06-10 17:03:55 -04:00
AlanCoding
39b410ae3e hide passwords in job_args and activity stream 2016-06-08 10:28:53 -04:00
Wayne Witzel III
61208f6a77 content_object can be None, that is what we care about 2016-05-26 15:45:16 -04:00