From Dan Kenigsberg <[email protected]>: Dan Kenigsberg has posted comments on this change.
Change subject: ngn: grab OS version according with /etc/os-release ...................................................................... Patch Set 4: Code-Review-1 (2 comments) nits only https://gerrit.ovirt.org/#/c/72829/4/lib/vdsm/osinfo.py File lib/vdsm/osinfo.py: Line 140: True if it's oVirt Node Next or RHV Node Line 141: """ Line 142: ts = rpm.TransactionSet() Line 143: for pkg in ts.dbMatch(): Line 144: if pkg['name'] == "redhat-release-virtualization-host" or \ open parenthesis to avoid trainling backslash. there are no doublequotes in this file, no need to add them. Line 145: pkg['name'] == "ovirt-release-host-node": Line 146: return True Line 147: Line 148: return False Line 185: Line 186: @utils.memoized Line 187: def version(): Line 188: version = release_name = '' Line 189: > Woudln't it be better to parse /etc/os-release only once here, save result I prefer not to clutter the main-and-already-too-long version() function with a cache of os-release fields. To avoid double-parsing, I think that @utils.memoized on top of _get_os_release_data() would be cleaner Line 190: osname = _release_name() Line 191: pretty_name = _get_pretty_name() Line 192: try: Line 193: if osname == OSName.RHEVH or osname == OSName.OVIRT: -- To view, visit https://gerrit.ovirt.org/72829 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f35d8f2221c07a38e9d75b96324315266b0d51a Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Dan Kenigsberg <[email protected]> Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]> Gerrit-Reviewer: Fabian Deutsch <[email protected]> Gerrit-Reviewer: Ido Rosenzwig <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Peřina <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Ryan Barry <[email protected]> Gerrit-Reviewer: Sandro Bonazzola <[email protected]> Gerrit-Reviewer: Yuval Turgeman <[email protected]> Gerrit-Reviewer: gerrit-hooks <[email protected]> Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list -- [email protected] To unsubscribe send an email to [email protected]
