Compare commits
2 Commits
7d980a744d
...
273c4dead5
| Author | SHA1 | Date | |
|---|---|---|---|
| 273c4dead5 | |||
| 2b021d633a |
@ -47,7 +47,7 @@ class GLPIAPI:
|
||||
|
||||
searchUri = f"{self.Server}/apirest.php/search/Computer?{search_parameter}"
|
||||
search = requests.get(searchUri, headers=self.Headers)
|
||||
print(search.status_code)
|
||||
|
||||
if(search.status_code == 200):
|
||||
search = search.json()
|
||||
if(search["totalcount"] == 1):
|
||||
@ -58,8 +58,7 @@ class GLPIAPI:
|
||||
elif(search["totalcount"] > 1):
|
||||
deviceID = list(search["data"].keys())
|
||||
return deviceID, search["data"], search["totalcount"]
|
||||
else:
|
||||
return None, None, 0
|
||||
|
||||
return None, None, 0
|
||||
|
||||
def GetUser(self, username=None, email=None):
|
||||
@ -80,7 +79,7 @@ class GLPIAPI:
|
||||
elif(search["totalcount"] > 1):
|
||||
userID = list(search["data"].keys())
|
||||
return userID, search["data"], search["totalcount"]
|
||||
else:
|
||||
|
||||
return None, None, 0
|
||||
|
||||
def UpdateInventory(self, inventory):
|
||||
|
||||
Reference in New Issue
Block a user