mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 02:17:37 -02:30
Fix AC-758 where we weren't considering whether the license was expired when deciding to allow creating more hosts
This commit is contained in:
@@ -354,11 +354,14 @@ class HostAccess(BaseAccess):
|
|||||||
# but still go down *most* of the license code path.
|
# but still go down *most* of the license code path.
|
||||||
validation_info['free_instances'] = 99999999
|
validation_info['free_instances'] = 99999999
|
||||||
|
|
||||||
|
if not validation_info.get('demo') and validation_info.get('time_remaining') < 0:
|
||||||
|
raise PermissionDenied("license has expired")
|
||||||
|
|
||||||
if validation_info.get('free_instances', 0) > 0:
|
if validation_info.get('free_instances', 0) > 0:
|
||||||
# BOOKMARK
|
# BOOKMARK
|
||||||
return True
|
return True
|
||||||
instances = validation_info.get('available_instances', 0)
|
instances = validation_info.get('available_instances', 0)
|
||||||
raise PermissionDenied("license range of %s instances has been exceed" % instances)
|
raise PermissionDenied("license range of %s instances has been exceeded" % instances)
|
||||||
|
|
||||||
def can_change(self, obj, data):
|
def can_change(self, obj, data):
|
||||||
# Prevent moving a host to a different inventory.
|
# Prevent moving a host to a different inventory.
|
||||||
|
|||||||
Reference in New Issue
Block a user