Commit 75bc5809 authored by Andrey Vertiprahov's avatar Andrey Vertiprahov

Merge branch 'noc-fix-version-newline' into 'master'

Remove newline from version info

See merge request !2481
parents 5fb7bd3b 74e1d38b
Pipeline #15266 passed with stages
in 18 minutes and 2 seconds
......@@ -149,7 +149,7 @@ def urlopen(url, auto_deflate=False):
setup_urllib_proxies()
if url.startswith("http://") or url.startswith("https://"):
r = Request(url, headers={"User-Agent": "NOC/%s" % version.version})
r = Request(url, headers={"User-Agent": "NOC/%s" % version.version.strip()})
else:
r = url
if auto_deflate and url.endswith(".gz"):
......
......@@ -76,10 +76,10 @@ class Version(object):
["git", "describe", "--tags", "--abbrev=%d" % CHANGESET_LEN]
)
if "-" not in v:
return v
return v.strip()
r = v.rsplit("-", 2)
if len(r) < 3:
return v
return v.strip()
v, n, cs = r
return "%s+%s.%s.%s" % (v, self.branch, n, cs[1 : CHANGESET_LEN + 1])
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment