Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
make it case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
kgaikwad committed Jun 16, 2021
1 parent c7bbb4e commit 7130191
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion yupana/processor/report_slice_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def is_valid_uuid(uuid):
except ValueError:
return False

return str(uuid_obj) == uuid
return str(uuid_obj) == uuid.lower()

def _remove_invalid_bios_uuid(self, host):
"""Remove invalid bios UUID."""
Expand Down
9 changes: 9 additions & 0 deletions yupana/processor/tests_report_slice_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,3 +882,12 @@ def test_do_not_remove_valid_bios_uuid(self):
}
new_host = self.processor._remove_invalid_bios_uuid(host)
self.assertEqual(new_host, host)

def test_bios_uuid_validation_should_be_case_insensitive(self):
"""Test bios UUID validation should be case insensitive."""
host = {
'fqdn': 'virt-who.example.com',
'bios_uuid': '801CA199-9402-41CE-98DC-F3AA6E5BC6B3'
}
new_host = self.processor._remove_invalid_bios_uuid(host)
self.assertEqual(new_host, host)

0 comments on commit 7130191

Please sign in to comment.