Refactor uuid handling
Fixed in Releases:
Found in Releases:
There are a couple of method in Foreman module for UUID handling that can be better.
#1 Updated by The Foreman Bot over 2 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/8119 added
#2 Updated by The Foreman Bot over 2 years ago
- Fixed in Releases 2.3.0 added
#3 Updated by Tomer Brisker over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|4705d72d170b7f4318db0bcc90864e6537511f27.
Fixes #31228 - Improve UUID check performance
Doing a full match for regexp including saving match data is slow when
all we care about is whether it is a UUID or not. Instead first rule out
quick checks (not a string, wrong length) and only then check with
`.match?` instead of `=~` which just returns a boolean without saving
the match data.