mirror of
https://github.com/ansible/awx.git
synced 2026-10-31 06:26:15 -02:30
Merge pull request #10590 from shanemcd/downstream-fixes
Downstream fixes Reviewed-by: Bianca Henderson <beeankha@gmail.com> Reviewed-by: Jake McDermott <yo@jakemcdermott.me>
This commit is contained in:
+2163
-2096
File diff suppressed because it is too large
Load Diff
+1720
-1690
File diff suppressed because it is too large
Load Diff
+1717
-1687
File diff suppressed because it is too large
Load Diff
+2161
-2094
File diff suppressed because it is too large
Load Diff
+1719
-1687
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
|
|
||||||
from django.utils.encoding import smart_text
|
from django.utils.encoding import smart_text
|
||||||
|
from django.utils.timezone import now
|
||||||
|
|
||||||
from awx.main.utils.common import set_current_apps
|
from awx.main.utils.common import set_current_apps
|
||||||
from awx.main.utils.common import parse_yaml_or_json
|
from awx.main.utils.common import parse_yaml_or_json
|
||||||
@@ -96,6 +97,21 @@ def delete_custom_inv_source(apps, schema_editor):
|
|||||||
set_current_apps(apps)
|
set_current_apps(apps)
|
||||||
InventorySource = apps.get_model('main', 'InventorySource')
|
InventorySource = apps.get_model('main', 'InventorySource')
|
||||||
InventoryUpdate = apps.get_model('main', 'InventoryUpdate')
|
InventoryUpdate = apps.get_model('main', 'InventoryUpdate')
|
||||||
|
Schedule = apps.get_model('main', 'Schedule')
|
||||||
|
|
||||||
|
saved_time = now()
|
||||||
|
|
||||||
|
# We cannot allow polymorphic.SET_NULL relationships to exist before we delete any InventorySources or InventoryUpdates or Schedules
|
||||||
|
# so we do this hack of updating modified time so we can keep track of which schedules to delete (b/c we nulled the relationships)
|
||||||
|
Schedule.objects.filter(unified_job_template__inventorysource__source='custom').update(modified=saved_time)
|
||||||
|
InventoryUpdate.objects.filter(source='custom', schedule__isnull=False).update(schedule=None)
|
||||||
|
InventorySource.objects.filter(source='custom', next_schedule__isnull=False).update(next_schedule=None)
|
||||||
|
|
||||||
|
# safe to delete Schedule objects with no schedule or next_schedule pointers from UJ or UJT tables
|
||||||
|
ct, deletions = Schedule.objects.filter(modified=saved_time).delete()
|
||||||
|
if ct:
|
||||||
|
logger.info('deleted {} custom inventory source schedules: {}'.format(ct, deletions))
|
||||||
|
|
||||||
ct, deletions = InventoryUpdate.objects.filter(source='custom').delete()
|
ct, deletions = InventoryUpdate.objects.filter(source='custom').delete()
|
||||||
if ct:
|
if ct:
|
||||||
logger.info('deleted {}'.format((ct, deletions)))
|
logger.info('deleted {}'.format((ct, deletions)))
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"BRAND_NAME": "AWX",
|
"BRAND_NAME": "Ansible AWX",
|
||||||
"PENDO_API_KEY": ""
|
"PENDO_API_KEY": ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function About({ version, isOpen, onClose }) {
|
|||||||
<AboutModal
|
<AboutModal
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
productName={`Ansible ${brandName.current}`}
|
productName={brandName.current}
|
||||||
trademark={`${copyright} ${new Date().getFullYear()} ${redHatInc}`}
|
trademark={`${copyright} ${new Date().getFullYear()} ${redHatInc}`}
|
||||||
brandImageSrc="/static/media/logo-header.svg"
|
brandImageSrc="/static/media/logo-header.svg"
|
||||||
brandImageAlt={t`Brand Image`}
|
brandImageAlt={t`Brand Image`}
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ function PaginatedTable({
|
|||||||
const { search, pathname } = useLocation();
|
const { search, pathname } = useLocation();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
|
if (!pluralizedItemName) {
|
||||||
|
pluralizedItemName = t`Items`;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
clearSelected();
|
clearSelected();
|
||||||
@@ -198,7 +201,7 @@ PaginatedTable.defaultProps = {
|
|||||||
toolbarSearchColumns: [],
|
toolbarSearchColumns: [],
|
||||||
toolbarSearchableKeys: [],
|
toolbarSearchableKeys: [],
|
||||||
toolbarRelatedSearchableKeys: [],
|
toolbarRelatedSearchableKeys: [],
|
||||||
pluralizedItemName: 'Items',
|
pluralizedItemName: null,
|
||||||
showPageSizeOptions: true,
|
showPageSizeOptions: true,
|
||||||
renderToolbar: props => <DataListToolbar {...props} />,
|
renderToolbar: props => <DataListToolbar {...props} />,
|
||||||
ouiaId: null,
|
ouiaId: null,
|
||||||
|
|||||||
+3464
-4496
File diff suppressed because it is too large
Load Diff
+2148
-3154
File diff suppressed because it is too large
Load Diff
+2117
-3136
File diff suppressed because it is too large
Load Diff
+3455
-4496
File diff suppressed because it is too large
Load Diff
+2115
-3131
File diff suppressed because it is too large
Load Diff
@@ -87,6 +87,9 @@ function CredentialInput({
|
|||||||
id={`credential-${fieldOptions.id}`}
|
id={`credential-${fieldOptions.id}`}
|
||||||
type="text"
|
type="text"
|
||||||
filename={fileName}
|
filename={fileName}
|
||||||
|
filenamePlaceholder={t`Drag a file here or browse to upload`}
|
||||||
|
browseButtonText={t`Browse…`}
|
||||||
|
clearButtonText={t`Clear`}
|
||||||
onChange={handleFileChange}
|
onChange={handleFileChange}
|
||||||
onReadStarted={() => setFileIsUploading(true)}
|
onReadStarted={() => setFileIsUploading(true)}
|
||||||
onReadFinished={() => setFileIsUploading(false)}
|
onReadFinished={() => setFileIsUploading(false)}
|
||||||
@@ -105,6 +108,9 @@ function CredentialInput({
|
|||||||
id={`credential-${fieldOptions.id}`}
|
id={`credential-${fieldOptions.id}`}
|
||||||
type="text"
|
type="text"
|
||||||
filename={fileName}
|
filename={fileName}
|
||||||
|
filenamePlaceholder={t`Drag a file here or browse to upload`}
|
||||||
|
browseButtonText={t`Browse…`}
|
||||||
|
clearButtonText={t`Clear`}
|
||||||
onChange={handleFileChange}
|
onChange={handleFileChange}
|
||||||
onReadStarted={() => setFileIsUploading(true)}
|
onReadStarted={() => setFileIsUploading(true)}
|
||||||
onReadFinished={() => setFileIsUploading(false)}
|
onReadFinished={() => setFileIsUploading(false)}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ export default typeFieldNames;
|
|||||||
const initialConfigValues = {};
|
const initialConfigValues = {};
|
||||||
Object.keys(typeFieldNames).forEach(key => {
|
Object.keys(typeFieldNames).forEach(key => {
|
||||||
typeFieldNames[key].forEach(fieldName => {
|
typeFieldNames[key].forEach(fieldName => {
|
||||||
const isBoolean = fieldName.includes('_ssl');
|
const isBoolean = fieldName.includes('_ssl') || fieldName === 'use_tls';
|
||||||
initialConfigValues[fieldName] = isBoolean ? false : '';
|
initialConfigValues[fieldName] = isBoolean ? false : '';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ export default function getDocsBaseUrl(config) {
|
|||||||
if (licenseType && licenseType !== 'open') {
|
if (licenseType && licenseType !== 'open') {
|
||||||
version = config?.version ? config.version.split('-')[0] : 'latest';
|
version = config?.version ? config.version.split('-')[0] : 'latest';
|
||||||
}
|
}
|
||||||
return `https://docs.ansible.com/ansible-tower/${version}`;
|
return `https://docs.ansible.com/automation-controller/${version}`;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ describe('getDocsBaseUrl', () => {
|
|||||||
version: '18.0.0',
|
version: '18.0.0',
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual('https://docs.ansible.com/ansible-tower/latest');
|
expect(result).toEqual(
|
||||||
|
'https://docs.ansible.com/automation-controller/latest'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return current version for enterprise license', () => {
|
it('should return current version for enterprise license', () => {
|
||||||
@@ -20,7 +22,9 @@ describe('getDocsBaseUrl', () => {
|
|||||||
version: '4.0.0',
|
version: '4.0.0',
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual('https://docs.ansible.com/ansible-tower/4.0.0');
|
expect(result).toEqual(
|
||||||
|
'https://docs.ansible.com/automation-controller/4.0.0'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should strip version info after hyphen', () => {
|
it('should strip version info after hyphen', () => {
|
||||||
@@ -31,7 +35,9 @@ describe('getDocsBaseUrl', () => {
|
|||||||
version: '4.0.0-beta',
|
version: '4.0.0-beta',
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual('https://docs.ansible.com/ansible-tower/4.0.0');
|
expect(result).toEqual(
|
||||||
|
'https://docs.ansible.com/automation-controller/4.0.0'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return latest version if license info missing', () => {
|
it('should return latest version if license info missing', () => {
|
||||||
@@ -39,6 +45,8 @@ describe('getDocsBaseUrl', () => {
|
|||||||
version: '18.0.0',
|
version: '18.0.0',
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(result).toEqual('https://docs.ansible.com/ansible-tower/latest');
|
expect(result).toEqual(
|
||||||
|
'https://docs.ansible.com/automation-controller/latest'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
aiohttp
|
aiohttp
|
||||||
ansible-runner==2.0.0
|
ansible-runner==2.0.1
|
||||||
ansiconv==1.0.0 # UPGRADE BLOCKER: from 2013, consider replacing instead of upgrading
|
ansiconv==1.0.0 # UPGRADE BLOCKER: from 2013, consider replacing instead of upgrading
|
||||||
asciichartpy
|
asciichartpy
|
||||||
autobahn>=20.12.3 # CVE-2020-35678
|
autobahn>=20.12.3 # CVE-2020-35678
|
||||||
@@ -45,7 +45,7 @@ python3-saml
|
|||||||
python-dsv-sdk
|
python-dsv-sdk
|
||||||
python-ldap>=3.3.1 # https://github.com/python-ldap/python-ldap/issues/270
|
python-ldap>=3.3.1 # https://github.com/python-ldap/python-ldap/issues/270
|
||||||
pyyaml>=5.4.1 # minimum to fix https://github.com/yaml/pyyaml/issues/478
|
pyyaml>=5.4.1 # minimum to fix https://github.com/yaml/pyyaml/issues/478
|
||||||
receptorctl==1.0.0.0rc1
|
receptorctl==1.0.0
|
||||||
schedule==0.6.0
|
schedule==0.6.0
|
||||||
social-auth-core==3.3.1 # see UPGRADE BLOCKERs
|
social-auth-core==3.3.1 # see UPGRADE BLOCKERs
|
||||||
social-auth-app-django==3.1.0 # see UPGRADE BLOCKERs
|
social-auth-app-django==3.1.0 # see UPGRADE BLOCKERs
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ aiohttp==3.6.2
|
|||||||
# via -r /awx_devel/requirements/requirements.in
|
# via -r /awx_devel/requirements/requirements.in
|
||||||
aioredis==1.3.1
|
aioredis==1.3.1
|
||||||
# via channels-redis
|
# via channels-redis
|
||||||
ansible-runner==2.0.0
|
ansible-runner==2.0.1
|
||||||
# via -r /awx_devel/requirements/requirements.in
|
# via -r /awx_devel/requirements/requirements.in
|
||||||
ansiconv==1.0.0
|
ansiconv==1.0.0
|
||||||
# via -r /awx_devel/requirements/requirements.in
|
# via -r /awx_devel/requirements/requirements.in
|
||||||
@@ -299,7 +299,7 @@ pyyaml==5.4.1
|
|||||||
# djangorestframework-yaml
|
# djangorestframework-yaml
|
||||||
# kubernetes
|
# kubernetes
|
||||||
# receptorctl
|
# receptorctl
|
||||||
receptorctl==1.0.0.0rc1
|
receptorctl==1.0.0
|
||||||
# via -r /awx_devel/requirements/requirements.in
|
# via -r /awx_devel/requirements/requirements.in
|
||||||
redis==3.4.1
|
redis==3.4.1
|
||||||
# via
|
# via
|
||||||
|
|||||||
Reference in New Issue
Block a user