replace dash with underscore in os name/version (#7381)

Fixes #7356

In some cases OperatingSystem (e.g. LinuxDistro) was getting
instantiated with a version that contains dashes. This breaks because
the concretizer later converts this value to a string and re-parses
it, and the '-' character is used to separate architecture components.
This adds a guard in the initializer to convert '-' to '_'.
This commit is contained in:
scheibelp 2018-03-09 10:03:58 -08:00 committed by GitHub
parent 869c654c37
commit f27f20e5b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -240,8 +240,8 @@ class OperatingSystem(object):
"""
def __init__(self, name, version):
self.name = name
self.version = version
self.name = name.replace('-', '_')
self.version = str(version).replace('-', '_')
def __str__(self):
return "%s%s" % (self.name, self.version)