Commit Graph

3532 Commits

Author SHA1 Message Date
Alan Rominger
83bc654b15 Merge pull request #5812 from AlanCoding/no_loops_for_hackers
Block loops in querystring filters
2017-03-21 10:50:35 -04:00
Ryan Petrello
a69dfced74 Merge remote-tracking branch 'origin/release_3.1.2' into devel 2017-03-21 10:39:16 -04:00
AlanCoding
925712e3ec block users from making looping filters which can DoS Tower 2017-03-21 10:16:49 -04:00
Ryan Petrello
ba0e9ab775 copy extra_vars when relaunching ad-hoc commands
see: #1744
2017-03-21 09:45:30 -04:00
Aaron Tan
f69c2569d6 Smarter log aggregator host name generation. 2017-03-20 13:20:16 -04:00
Aaron Tan
fe78d86c4a Merge pull request #5747 from jangsutsr/5728_handle_can_start_without_user_input_cornercase
Handle can_start_without_user_input cornercase
2017-03-20 13:03:22 -04:00
Aaron Tan
2e2d88516e Negative functional test added. 2017-03-20 12:21:21 -04:00
Aaron Tan
2edd4b338d Add functional test to gurarantee consistent behavior of provisioning callback with jt launch. 2017-03-17 15:40:55 -04:00
Aaron Tan
6083e9482e Refactor job template callback post to mimic the behavior of normal jt launch. 2017-03-17 13:04:45 -04:00
Aaron Tan
90bcc3d6ab Unit test added. 2017-03-16 11:08:19 -04:00
Aaron Tan
95e41e078c Handle can_start_without_user_input cornercase. 2017-03-15 17:42:59 -04:00
Ryan Petrello
98ad2684d3 when async log shipping fails, log an explanation 2017-03-15 17:23:44 -04:00
Ryan Petrello
b3733d233e always use async http logging - even in celery workers
additionally, add a timeout to requests to avoid thread starvation

see: #5718
see: #5729
2017-03-15 13:17:01 -04:00
Chris Meyers
8d2b3b2b82 Merge pull request #5705 from chrismeyersfsu/fix-5700
add job cancel dependency information
2017-03-14 15:00:15 -04:00
Matthew Jones
bc4174adf8 Ignore .retry files for project updates 2017-03-14 13:23:14 -04:00
Matthew Jones
47a894a339 Fix up cloudforms license unit test 2017-03-13 21:02:36 -04:00
Chris Meyers
33dca18119 more tests 2017-03-13 15:05:33 -04:00
Chris Meyers
a051b41773 add test 2017-03-13 14:45:20 -04:00
Chris Meyers
6a0916371b add job cancel dependency information
* Inventory updates that are canceled and are dependencies of jobs
result in the dependent job being canceled. This code adds a better
description to job_explanation so that a job marked as canceled can be
traced back to the inventory update that triggered this case.
2017-03-13 12:52:33 -04:00
Matthew Jones
2641b2a1c3 Implement cloudforms license
This is a special license that is triggered in the presence of two
directories:
  - /opt/rh/cfme-appliance
  - /opt/rh/cfme-gemset
and the rpms
  - cfme
  - cfme-appliance
  - cfme-gemset

All of which I'm assured are responsible for validating that this is
indeed an enterprise cloudforms environment.

When these are present then a license is used that is near perpetual,
allows for a stupid large number of instances, and turns on all features
2017-03-13 12:00:22 -04:00
Ryan Petrello
bad9670a0b Merge remote-tracking branch 'origin/release_3.1.2' into devel 2017-03-10 10:57:03 -05:00
Ryan Petrello
f4d4c43d94 prohibit order_by= for sensitive fields
see: #5526
2017-03-10 08:49:59 -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