-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: (SIMP-9753) Add legacy/productmd treeinfo parser #166
base: master
Are you sure you want to change the base?
Conversation
This patch adds a .treeinfo parser that understands the EL7 legacy format and the EL8+ productmd treeinfo 1.x format[0]. [SIMP-9753] #close [0]: https://productmd.readthedocs.io/en/1.2/treeinfo-1.1.html
# release version, for example: "21", "7.0", "2.1" | ||
# @return [String] | ||
def release_version | ||
@treeinfo_maj_version > 0 ? section('release')['version'] : section('general')['version'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if section() returns nil? This code does not handle that error case in a fashion that an end-user would understand. In other words, the error message from operating on a nil object would be incomprehensible to the end user.
unless version.to_s.split('.').first == '1' | ||
fail "ERROR: Unsupported productmd .treeinfo version: '#{version}': '#{@file}'" | ||
end | ||
warn "Detected productmd .treeinfo, version '#{verison}'" if @verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this code send debug messages to $stderr?
unless version.to_s.split('.').first == '1' | ||
fail "ERROR: Unsupported productmd .treeinfo version: '#{version}': '#{@file}'" | ||
end | ||
warn "Detected productmd .treeinfo, version '#{verison}'" if @verbose |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does @verbose
get enabled?
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where are the tests for the error cases (e.g., invalid or unsupported treeinfo version)?
This patch adds a .treeinfo parser that understands the EL7 legacy
format and the EL8+ productmd 1.x treeinfo 1.x format [0] .
SIMP-9753 #close
[0]: https://productmd.readthedocs.io/en/1.2/treeinfo-1.1.html