don't fail on osinfo lookup for beta and lookahead

This commit is contained in:
Trevor Cooper 2023-09-23 20:27:46 -07:00
parent 14b60174d6
commit fe8b338c8b
Signed by: tcooper
GPG Key ID: 52364D7BBCEB35B8

View File

@ -250,6 +250,9 @@ class VirtInstallImage(object):
# properly returns 1 on failure, but using workaround for old # properly returns 1 on failure, but using workaround for old
# bug where it didn't in case EPEL doesn't have 0.3.1 # bug where it didn't in case EPEL doesn't have 0.3.1
shortid = "rocky{0}".format(self.release) shortid = "rocky{0}".format(self.release)
# rocky has beta, rc# and lookahead releases that aren't in osinfo db
# replace text suffix in those with unknown.
shortid = "{0}-unknown".format(shortid.split('-')[0])
args = ["osinfo-query", "os", "short-id={0}".format(shortid)] args = ["osinfo-query", "os", "short-id={0}".format(shortid)]
process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
out = process.communicate()[0].decode() out = process.communicate()[0].decode()