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