Commit Graph

40 Commits

Author SHA1 Message Date
Alan Rominger
29ad6e1eaa Fix bug, None was used instead of empty for DB outage (#14463) 2023-09-21 14:30:25 -04:00
Shane McDonald
f1196fc019 Clean up string formatting issues from black migration 2023-05-10 08:19:23 -04:00
jessicamack
b5e04a4cb3 AWX code changes for rsyslog decoupling (#13222)
* add management command and logging for new daemon
* switch tasks over to calling pg_notify
* add daemon to docker-compose and supervisor
* renamed handle_setting_changes and moved notify call
* removed initial rsyslog configure from dispatcher
* add logging and clear cache before reconfigure
* add notify to delete
* moved pg_notify to own function
* update tests impacted by rsyslog change
* changed over to new pg_notify method

Signed-off-by: Jessica Mack <jmack@redhat.com>
2023-03-29 22:04:43 -04:00
Alan Rominger
7f50679e68 Do not create setting with invalid value in data migration (#13576)
* Do not create setting with invalid value in data migration

* Add test for conf app data migration
2023-02-15 14:54:46 -05:00
Alan Rominger
f5785976be Update to comply with new black rules 2023-02-01 14:59:38 -05:00
Alan Rominger
aaad634483 Only use in-memory cache for database settings, set ttl=5 (#12166)
* Only use in-memory cache for database settings

Make necessary adjustments to monkeypatch
  as it is very vunerable to recursion
  Remove migration exception that is now redundant

Clear cache if a setting is changed

* Use dedicated middleware for setting cache stuff
  Clear cache for each request

* Add tests for in-memory cache
2022-05-10 21:58:22 -04:00
Jeff Bradberry
a3a216f91f Fix up new Django 3.0 deprecations
Mostly text based: force/smart_text, ugettext_*
2022-03-07 18:11:36 -05:00
Ryan Petrello
c2ef0a6500 move code linting to a stricter pep8-esque auto-formatting tool, black 2021-03-23 09:39:58 -04:00
Rebeccah
118e1b8df1 removing memchache mentions in comments
remove memcached folder as it is no longer needed, also address a couple grammatical errors
2020-06-18 15:52:59 -04:00
Shane McDonald
de82c613fc Make tests pass with current versions of things 2020-06-15 23:13:44 -04:00
Christian Adams
d350551547 Tweaks to Test Button logic and cleans up flake8 and test failures 2020-04-13 11:43:59 -04:00
Seth Foster
7e83ddc968 Fix URLField to allow numbers in top level domain
Add a custom regex to URLField that allows numbers to be present in the
top level domain, e.g. https://towerhost.org42

Set by variable allow_numbers_in_top_level_domain in URLField __init__,
and is set to True by default. If set to False, it will use the regex
specified in the built-in django URLValidator class.

This solution was originally implemented in LDAPServerURIField, but is
now implemented in URLField to support this behavior more generally. The
changes in LDAPServerURIField are longer needed and have been removed in
this commit.

Adds unit testing to make sure URLField changes handle regex input
and settings correctly.
2019-10-28 13:47:01 -04:00
Jeff Bradberry
758ad164fe Include defined fields from all parent classes of a HybridDictField
since our settings registry adds a mixin class when doing validation on these.

related #4099
2019-07-08 16:05:03 -04:00
Ryan Petrello
6da445f7c0 remove /api/v1 and deprecated credential fields 2019-06-06 12:23:00 -04:00
AlanCoding
8c2b3e9b84 Fix Django 2.0 deprecation warnings 2019-04-22 14:17:14 -04:00
beeankha
de34a64115 Basic License feature gating changes 2019-04-12 11:28:27 -04:00
Vismay Golwala
ec390b049d Feature: custom virtual environment directories
Currently, users are allowed to define virtual environments in
`settings.BASE_VENV_PATH` only, because that's the only place
Tower looks for virtual environments. This feature allows users
to custom define the directory paths, using API or UI, to look
for virtual environments. Tower aggregates virtual environments
from all these paths, except environments with special name `awx`.

Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
2019-03-26 12:04:17 -04:00
Ryan Petrello
daeeaf413a clean up unnecessary usage of the six library (awx only supports py3) 2019-01-25 00:19:48 -05:00
Ryan Petrello
f223df303f convert py2 -> py3 2019-01-15 14:09:01 -05:00
chris meyers
04767641af isolate cache 2018-05-17 12:58:11 -04:00
AlanCoding
ac20aa954a Replace logging-related restart with dynamic handler
refactor existing handlers to be the related
  "real" handler classes, which are swapped
  out dynamically by external logger "proxy" handler class

real handler swapout only done on setting change

remove restart_local_services method
get rid of uWSGI fifo file

change TCP/UDP return type contract so that it mirrors
  the request futures object
add details to socket error messages
2018-05-02 09:47:22 -04:00
Chris Meyers
032318494b added tests for new settings field type 2017-11-29 11:52:00 -05:00
Aaron Tan
42bbd7d47a Merge pull request #18 from jangsutsr/wrap_up_ctint_unit_tests
Wrap up Tower configuration unit tests
2017-09-07 09:49:14 -04:00
Ryan Petrello
44702c5cfd fix broken shippable test suite 2017-09-06 16:12:43 -07:00
Aaron Tan
64b6b18a81 Wrap up Tower configuration unit tests 2017-09-05 15:16:51 -04:00
AlanCoding
9254bcaf16 Make cache compatible with encrypted settings
This saves the id value of the setting into the cache
if the setting is encrypted. That can then be combined
with the secret_key in order to decrypt the setting,
without having to make an additional query to the database.
2017-08-17 17:18:41 -04:00
Aaron Tan
f1869a2f70 Merge pull request #6220 from jangsutsr/6188_enable_ctint_category_specific_validation
Enable Tower configuration category-specific validation
2017-06-26 09:45:12 -04:00
Wayne Witzel III
f9b412419c update encryption migration checks and tests 2017-06-15 12:06:18 -04:00
Wayne Witzel III
af7762e417 Fix typo and update tests to catch other typos 2017-06-12 14:14:46 -04:00
Wayne Witzel III
8d96d08510 Add Re-Encryption migrations, helpers, and tests 2017-06-12 09:54:12 -04:00
Wayne Witzel III
b5d61c3c53 Relocate encryption helpers, update settings, tests, and imports 2017-06-12 09:54:12 -04:00
Aaron Tan
69dc56c5a1 Enable CTinT category-specific validation. 2017-05-22 17:13:38 -04:00
Ryan Petrello
64a973ae02 work around a unicode handling bug in python-memcached that affects py2
see: https://github.com/linsomniac/python-memcached/issues/79
see: #5276
2017-02-13 16:09:31 -05:00
Ryan Petrello
1ebb641c1e work around a DRF issue that causes CharField to cast None to "None"
see: #5322
2017-02-13 12:43:13 -05:00
Ryan Petrello
52ff35ab3f fix a CTinT bug in static config parsing
see: #5223
2017-02-07 14:42:04 -05:00
Ryan Petrello
afc0f16e58 add a field to OPTIONS that tells if the setting came from a .py file
additionally, update help_text with a helpful message about this

See: #4876
2017-02-02 12:47:53 -05:00
Ryan Petrello
9d98ac5e37 clean up a few complicated mocks 2017-02-01 12:56:20 -05:00
Ryan Petrello
557bc8006d automatically encrypt/decrypt CTinT settings that are stored in memcached
addresses #4246
2017-02-01 12:53:10 -05:00
Ryan Petrello
d6857cf65a add some more inline comments and minor refactoring to awx.conf 2017-01-30 12:37:17 -05:00
Ryan Petrello
836ca21b7e add unit tests for awx.conf 2017-01-30 12:37:11 -05:00