forked from Sysdeploy/idlers-agent
skip device which doesn't have model number
This commit is contained in:
parent
75744e0010
commit
601bed9a34
7
agent.py
7
agent.py
|
@ -124,7 +124,12 @@ class ServerData:
|
|||
|
||||
# Parse the output
|
||||
details = {}
|
||||
details['model_number'] = re.search(r'Model Number:\s*(.*)', output).group(1)
|
||||
model_number_match = re.search(r'Model Number:\s*(.*)', output)
|
||||
if model_number_match is None:
|
||||
logging.warning("Skipping device {} as it does not have a model number".format(device))
|
||||
continue
|
||||
|
||||
details['model_number'] = model_number_match.group(1)
|
||||
details['serial_number'] = re.search(r'Serial Number:\s*(.*)', output).group(1)
|
||||
details['firmware_revision'] = re.search(r'Firmware Revision:\s*(.*)', output).group(1)
|
||||
details['transport'] = re.search(r'Transport:\s*(.*)', output).group(1)
|
||||
|
|
Loading…
Reference in New Issue
Block a user