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