Commit Graph

3411 Commits

Author SHA1 Message Date
Ryan Petrello
bad9670a0b Merge remote-tracking branch 'origin/release_3.1.2' into devel 2017-03-10 10:57:03 -05:00
Ryan Petrello
8c1de7f109 add an API endpoint for testing external log aggregrator connectivity
see: #5164
2017-03-09 13:19:56 -05:00
Matthew Jones
a1fce99e67 Merge branch 'stable' into devel 2017-03-08 15:35:09 -05:00
Wayne Witzel III
27fc64eb56 value_to_python should encode lookup fields as ascii 2017-03-08 12:30:30 -05:00
Matthew Jones
071f84d224 Skip requirements test, until it gets some love 2017-03-07 16:48:52 -05:00
Ryan Petrello
255d6afb49 fix a traceback if tower doesn't have LOG_AGGREGATOR_TOWER_UUID set
see: #5527
2017-03-07 16:48:51 -05:00
Chris Meyers
4005cf927e copy existing env before making a safe env
* We should not modify the original env because it's what is going to be
passed to the Ansible process. This will contain all of the passwords,
unobscured. The safe env is what will get saved into the model.
2017-03-07 16:48:48 -05:00
AlanCoding
0046421f05 set log formatter message type 2017-03-07 16:48:48 -05:00
Ryan Petrello
ae321536cd fix a regex that doesn't properly strip certain environment variables
see: #5601
2017-03-07 16:48:48 -05:00
Matthew Jones
50ccd1b003 Fix validation error grammar 2017-03-07 16:48:48 -05:00
Matthew Jones
95a2ed6336 Updates to insights playbook project syncing based on feedback
* Support "name" if given, else use a more reasonable file name for
  the playbook file
* Fix an issue where we wouldn't populate the playbooks correctly in
  the database
* Force downloading the playbooks every time since we can't tell when
  the file might change
2017-03-07 16:48:48 -05:00
Matthew Jones
2656e3f3fa Insights project api side integration
* Extend scm credential type to support username and password for
  redhat portal accounts
* Update project update playbook to work with remote insights server
2017-03-07 16:48:44 -05:00
Matthew Jones
90a26de180 Fix an issue where notifications might not always be triggered
In the case where a notification template were assigned to "failed"
events but not "success" or "any" events.
2017-03-06 15:41:43 -05:00
Chris Meyers
54bcdccdab give a default other than None
1. If the setting isn't in the database, then the specified default is
returned.
2. If the setting IS in the database, then the 'value' field, from the
database, is returned; Unless, the value is null in the database, then
the defined default is returned.
* Take case 1. If the default=None then an AttributeError is raised
* Thus, by setting default='', in case 1. We don't get an AttributeError
because '' will be returned.
* Also note that we don't allow_null=True because then the database
entry could be None. Accessing the setting would raise an AttributeError
in this case. Further, since we set default='' it doesn't matter if null
is in the database.

TL;DR set default=<something_other_than_None>
2017-03-02 13:36:48 -05:00
AlanCoding
f90ba8e6a6 small refactor of python requirement test to work in dev env 2017-03-01 09:04:31 -05:00
Chris Meyers
9db49d9819 Merge pull request #5586 from chrismeyersfsu/fix-job_start_websocket_race
emit job status over socket after database commit
2017-02-28 13:25:44 -05:00
Ryan Petrello
d97ff57cda prohibit API payloads that represent something other than a JSON object
The JSON serializer for our API uses ``json.loads``, which permits *any*
valid JSON (including bare integers, boolean values, etc).  Lots of our
code, however, assumes that inbound JSON content will be a dict.

see: #4756
2017-02-28 13:23:03 -05:00
Chris Meyers
c4fb88c0d9 remove uneeded post commit wrapper
* Since we changed the lower level method to always use post commit
message emit
2017-02-28 13:10:00 -05:00
Chris Meyers
e09497108e all job status change websockets events should happen after the job hits
the database
2017-02-28 12:56:55 -05:00
Chris Meyers
b85361732b Revert "emit job status over socket after database commit"
This reverts commit edefeeacdaf11cf484a4b4893ee9acde5ef85390.
2017-02-28 12:53:59 -05:00
Chris Meyers
7da52c8bef emit job status over socket after database commit
* Wait until the newly created job record hits the database before
telling the websocket clients that the job's status is "pending"
2017-02-28 12:39:55 -05:00
Ryan Petrello
45819f6b9a requeue websocket messages that don't (yet) have an established user
There's a race between our `ws_connect` and `ws_receive` methods;
it's possible to fall into a scenario where we're handling a legitimate
message *before* django-channels is able to persist the `user_id` into
the channel session.  This results in a scenario where a user can open
a browser tab and never receive new websocket messages.  In this
scenario, we should just toss the message back into the queue and try
again later (up to a reasonable limit of retries).
2017-02-28 11:12:59 -05:00
Matthew Jones
98daaece73 Switch job_type to check from sync when detecting delete_on_update 2017-02-27 16:22:05 -05:00
Chris Meyers
c1bace87ab only cancel deps if we can cancel the inv update 2017-02-27 11:37:29 -05:00
Chris Meyers
f3e514246e cancel jobs dependent on inv update 2017-02-27 11:28:29 -05:00
Chris Meyers
9f8df08e1d update tests 2017-02-27 10:56:34 -05:00
Chris Meyers
a1c76d3adc like inventory updates, check if project update deps already processed 2017-02-27 10:34:44 -05:00
Chris Meyers
dd513621f0 Revert "Merge pull request #5553 from chrismeyersfsu/fix-waiting_blocked"
This reverts commit 9ba2122f4f85eecaeb6fa53ac92ea2811b05e83f, reversing
changes made to c3a5f2c96fd85dd1405a8f5c875ffc988dee16a4.
2017-02-27 09:38:45 -05:00
Wayne Witzel III
4d02ee9445 Make current_groups a set to easily avoid duplicates, update asgi-amqp requirement 2017-02-24 16:59:39 -05:00
Chris Meyers
d020c81047 Merge pull request #5553 from chrismeyersfsu/fix-waiting_blocked
just like we fail running tasks fail waiting tasks
2017-02-24 16:18:02 -05:00
Chris Meyers
903d0472f0 just like we fail running tasks fail waiting tasks
* Associate the celery_id with the job at the earliest point possible.
This ensures that a waiting job has a celery id. Thus, we are free to
fail waiting jobs that don't have a celery id.
2017-02-24 12:07:04 -05:00
Matthew Jones
1a946d51c1 Fix an issue with sync vs run project updates
We need to not remove the source tree on project update run which
happens in the context of the job run to prevent the directory from
being deleted out from under the job runners. Since those will
inherently not block each other as the project update would
2017-02-24 11:03:48 -05:00
Chris Meyers
2f604f30d9 host may be None, account for that 2017-02-24 09:59:52 -05:00
Chris Meyers
fe3d79b5ec Revert "Merge pull request #5527 from chrismeyersfsu/fix-log_settings"
This reverts commit 3db0242ef9a8b1ce67e159b8a19e0c1e70330b7c, reversing
changes made to e6893bb7f3cf696c202c39103b432c20afa6ec08.
2017-02-24 09:59:34 -05:00
Matthew Jones
fd7c2550ee Fix a potential security issue in revision storage path name
It's too stable and could lead to a race condition
2017-02-23 16:21:13 -05:00
Chris Meyers
4e65e6624a Merge pull request #5527 from chrismeyersfsu/fix-log_settings
prevent traceback when host is set to null/None
2017-02-23 15:52:32 -05:00
Chris Meyers
50a8083984 flake8 2017-02-23 15:41:41 -05:00
Chris Meyers
08825a1f49 fix check running status 2017-02-23 15:09:50 -05:00
Chris Meyers
2953479dc8 correct behavior of tower_uuid logging setting
* Register a default=function() with LOG_AGGREGATOR_TOWER_UUID. We know
this function will ONLY be called when there is no database backed
settings. Therefore, we set a one-time uuid at this time.
* The user is free to change LOG_AGGREGATOR_TOWER_UUID.
* The user may not set this field to null
* The user may not set this field to ''
2017-02-23 14:31:47 -05:00
Chris Meyers
0b04001b15 host may be None, account for that 2017-02-23 14:31:24 -05:00
Ryan Petrello
fc583ead21 allow AD_HOC_COMMANDS to be set to [] in the settings ui
see: #4975
2017-02-23 10:51:54 -05:00
Alan Rominger
0bdcfbb33e Merge pull request #5512 from AlanCoding/inv_src_qs
Add InventorySource back into schedule queryset
2017-02-22 17:01:11 -05:00
AlanCoding
d85eda99c6 add back in Inv Src into schedule queryset computation 2017-02-22 15:34:18 -05:00
Matthew Jones
b14336bdff Alias unified job template search fields for presentation
The polymorphic accessors have a name that is different than our
normal presentation name for these types. This aliases them for the
presentation layer and then handles processing them when they are
given as filters.
2017-02-22 15:33:47 -05:00
Ryan Petrello
f11e9076cf Merge pull request #5505 from ryanpetrello/fix-5470
set the default in OPTIONS for TOWER_URL_BASE to the request hostname
2017-02-22 12:29:53 -05:00
Ryan Petrello
94ad12ab0d set the default in OPTIONS for TOWER_URL_BASE to the request hostname
see: #5470
2017-02-22 11:16:08 -05:00
Ryan Petrello
fe053dca83 Merge pull request #5495 from ryanpetrello/blacklist_sensitive_search_keys
blacklist certain sensitive fields and relations as search arguments
2017-02-22 10:28:03 -05:00
Chris Meyers
03d749a630 Merge pull request #5501 from chrismeyersfsu/private-performance_logging
be forgiving in log api log message fields list
2017-02-21 21:08:41 -05:00
Chris Meyers
427b484075 be forgiving in log api log message fields list 2017-02-21 19:24:27 -05:00
Ryan Petrello
d24fb32358 blacklist certain sensitive fields and relations as search arguments
see: #5465
see: #5478
2017-02-21 16:18:02 -05:00