Skip to content

Commit 3375095

Browse files
authored
Merge pull request #127 from grokability/jerm/dont-create-blank-modelnumbers
Don't create blank modelnumbers
2 parents 7e7ddb0 + df86a6a commit 3375095

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jamf2snipe

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -780,15 +780,15 @@ for jamf_type in jamf_types:
780780

781781
# Check that the model number exists in snipe, if not create it.
782782
if jamf_type == 'computers':
783-
if jamf['hardware']['model_identifier'] not in modelnumbers:
783+
if jamf['hardware']['model_identifier'] not in modelnumbers and jamf['hardware']['model_identifier']:
784784
logging.info("Could not find a model ID in snipe for: {}".format(jamf['hardware']['model_identifier']))
785785
newmodel = {"category_id":config['snipe-it']['computer_model_category_id'],"manufacturer_id":apple_manufacturer_id,"name": jamf['hardware']['model'],"model_number":jamf['hardware']['model_identifier']}
786786
if 'computer_custom_fieldset_id' in config['snipe-it']:
787787
fieldset_split = config['snipe-it']['computer_custom_fieldset_id']
788788
newmodel['fieldset_id'] = fieldset_split
789789
create_snipe_model(newmodel)
790790
elif jamf_type == 'mobile_devices':
791-
if jamf['general']['model_identifier'] not in modelnumbers:
791+
if jamf['general']['model_identifier'] not in modelnumbers and jamf['general']['model_identifier']:
792792
logging.info("Could not find a model ID in snipe for: {}".format(jamf['general']['model_identifier']))
793793
newmodel = {"category_id":config['snipe-it']['mobile_model_category_id'],"manufacturer_id":apple_manufacturer_id,"name": jamf['general']['model'],"model_number":jamf['general']['model_identifier']}
794794
if 'mobile_custom_fieldset_id' in config['snipe-it']:

0 commit comments

Comments
 (0)