simplify how awx "open" licensing works

This commit is contained in:
Ryan Petrello
2020-10-23 10:51:48 -04:00
parent e591f1f002
commit c139a998b8
3 changed files with 20 additions and 19 deletions
+5 -2
View File
@@ -202,10 +202,13 @@ def get_awx_http_client_headers():
def get_licenser(*args, **kwargs):
from awx.main.utils.licensing import Licenser, OpenLicense
try:
# Get License Config from db?
from awx.main.utils.licensing import Licenser
return Licenser(*args, **kwargs)
if os.path.exists('/var/lib/awx/.tower_version'):
return Licenser(*args, **kwargs)
else:
return OpenLicense()
except Exception as e:
raise ValueError(_('Error importing Tower License: %s') % e)