Correction bug filtre de recherche, ajout macOS dans les types d'appareil
This commit is contained in:
@@ -126,6 +126,7 @@ class GLPIAPI:
|
||||
platforms = {
|
||||
2:"Apple iOS",
|
||||
5:"Android",
|
||||
10:"Apple macOS",
|
||||
12:"Windows"
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ if(searchFilter != None):
|
||||
if(searchFilter == 'Id'):
|
||||
devices = [device for device in devices if getattr(device, "Id") == searchValue]
|
||||
else:
|
||||
devices = [device for device in devices if getattr(device, "searchFilter") == searchValue]
|
||||
devices = [device for device in devices if getattr(device, searchFilter) == searchValue]
|
||||
|
||||
for device in devices:
|
||||
if(device.EnrollmentStatus != 'Enrolled'):
|
||||
@@ -226,6 +226,7 @@ for device in devices:
|
||||
|
||||
inventory = glpiapi.CreateInventoryForAirwatchDevice(device, data["1"], apps)
|
||||
# Mise à jour du friendly name sur Airwatch
|
||||
print(device.PlatformId)
|
||||
platformName = inventory.operatingsystem["name"]
|
||||
osVersion = inventory.operatingsystem["version"]
|
||||
if(device.FriendlyName != f"{data['1']} {platformName} {osVersion} - {device.User}"):
|
||||
@@ -247,6 +248,7 @@ for device in devices:
|
||||
logger.info(f"Updating {deviceID} on GLPI")
|
||||
glpiapi.UpdateInventory(inventory.Json())
|
||||
|
||||
print(f"{data['70']} - {device.User}")
|
||||
if(data['70'] == None and device.User != settings["AIRWATCH"]["StagingUser"]):
|
||||
userID, userData, userCount = glpiapi.GetUser(device.User)
|
||||
if(userCount == 1):
|
||||
|
||||
Reference in New Issue
Block a user