reimplement licensing to work with RHSM and entitlement uploads

Co-authored-by: Christian Adams <chadams@redhat.com>
This commit is contained in:
Ryan Petrello
2020-10-22 10:56:26 -04:00
parent 48934e8544
commit 4445d096f5
42 changed files with 1117 additions and 174 deletions

View File

@@ -0,0 +1,20 @@
# Generated by Django 2.2.11 on 2020-08-04 15:19
import logging
from django.db import migrations
from awx.conf.migrations import _subscriptions as subscriptions
logger = logging.getLogger('awx.conf.migrations')
class Migration(migrations.Migration):
dependencies = [
('conf', '0007_v380_rename_more_settings'),
]
operations = [
migrations.RunPython(subscriptions.clear_old_license),
]

View File

@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
import logging
from django.conf import settings
from awx.main.utils.licensing import Licenser
logger = logging.getLogger('awx.conf.settings')
__all__ = ['clear_old_license']
def clear_old_license(apps, schema_editor):
# Setting = apps.get_model('conf', 'Organization')
# setting.objects.filter(key=LICENSE)
licenser = Licenser()
if licenser._check_product_cert():
settings.LICENSE = licenser.UNLICENSED_DATA.copy()