mirror of
https://github.com/ansible/awx.git
synced 2026-01-19 13:41:28 -03:30
update setting wording & add instance-enabled field
This commit is contained in:
parent
70af2dd66b
commit
58f0e42bd6
@ -175,9 +175,6 @@ class SettingsRegistry(object):
|
||||
# `PENDO_TRACKING_STATE` is disabled for the open source awx license
|
||||
if setting == 'PENDO_TRACKING_STATE' and get_license().get('license_type') == 'open':
|
||||
field_instance.read_only = True
|
||||
|
||||
if setting == 'INSIGHTS_DATA_ENABLED' and get_license().get('license_type') == 'open':
|
||||
field_instance.read_only = True
|
||||
|
||||
return field_instance
|
||||
|
||||
|
||||
@ -70,13 +70,14 @@ def gather(dest=None, module=None):
|
||||
if last_run < max_interval or not last_run:
|
||||
last_run = max_interval
|
||||
|
||||
if not settings.INSIGHTS_DATA_ENABLED:
|
||||
logger.exception("Insights analytics not enabled")
|
||||
return
|
||||
|
||||
if _valid_license() is False:
|
||||
logger.exception("Invalid License provided, or No License Provided")
|
||||
return
|
||||
|
||||
if not settings.INSIGHTS_DATA_ENABLED:
|
||||
logger.error("Insights analytics not enabled")
|
||||
return "Error: Insights analytics not enabled"
|
||||
|
||||
if module is None:
|
||||
from awx.main.analytics import collectors
|
||||
|
||||
@ -5,6 +5,7 @@ import tarfile
|
||||
|
||||
import pytest
|
||||
|
||||
from django.conf import settings
|
||||
from awx.main.analytics import gather, register
|
||||
|
||||
|
||||
@ -25,6 +26,7 @@ def throws_error(since):
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_gather():
|
||||
settings.INSIGHTS_DATA_ENABLED = True
|
||||
tgz = gather(module=importlib.import_module(__name__))
|
||||
files = {}
|
||||
with tarfile.open(tgz, "r:gz") as archive:
|
||||
@ -42,3 +44,4 @@ def test_gather():
|
||||
os.remove(tgz)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ def test_empty():
|
||||
"team": 0,
|
||||
"user": 0,
|
||||
"workflow_job_template": 0,
|
||||
'unified_job': 0
|
||||
"unified_job": 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user