1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-02 01:21:21 +03:00

Fix issue AC-1008... not checking license expiration when running import inventory

This commit is contained in:
Matthew Jones 2014-02-21 11:40:04 -05:00
parent a6a1a6504a
commit 43491721b6

View File

@ -702,7 +702,11 @@ class Command(NoArgsCommand):
license_info = reader.from_file() license_info = reader.from_file()
available_instances = license_info.get('available_instances', 0) available_instances = license_info.get('available_instances', 0)
free_instances = license_info.get('free_instances', 0) free_instances = license_info.get('free_instances', 0)
time_remaining = license_info.get('time_remaining', 0)
new_count = Host.objects.filter(active=True).count() new_count = Host.objects.filter(active=True).count()
if time_remaining <= 0:
self.logger.error('License has expired')
raise CommandError("License has expired!")
if free_instances < 0: if free_instances < 0:
d = { d = {
'new_count': new_count, 'new_count': new_count,
@ -737,6 +741,7 @@ class Command(NoArgsCommand):
if not self.source: if not self.source:
raise CommandError('--source is required') raise CommandError('--source is required')
self.check_license()
begin = time.time() begin = time.time()
self.load_inventory_from_database() self.load_inventory_from_database()