Differentiate between an expired license and a non-existant license

This commit is contained in:
Chris Meyers
2015-06-16 15:59:23 -04:00
parent 3522920b08
commit fcc789f13b
3 changed files with 41 additions and 19 deletions

View File

@@ -1223,12 +1223,6 @@ class InventoryUpdate(UnifiedJob, InventorySourceOptions):
def save(self, *args, **kwargs):
update_fields = kwargs.get('update_fields', [])
if bool(('license' in self.result_stdout or 'licensed' in self.result_stdout) and
'exceeded' in self.result_stdout and not self.license_error) or \
bool(any(x in self.result_stdout for x in ('License has expired', 'License count exceeded'))):
self.license_error = True
if 'license_error' not in update_fields:
update_fields.append('license_error')
inventory_source = self.inventory_source
if self.active and inventory_source.inventory and self.name == inventory_source.name:
if inventory_source.group: