Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Report on app-versions found across the launch

  • Loading branch information...
commit 4b27160cdf1ec7b12442f76d49edbc4554955f5a 1 parent 26cf0fa
@timf timf authored
Showing with 36 additions and 5 deletions.
  1. +36 −5 src/python/epumgmt/main/em_core_versions.py
View
41 src/python/epumgmt/main/em_core_versions.py
@@ -7,7 +7,8 @@ class VersionsNode:
def __init__(self, vm):
self.vm = vm
self.versions = []
- self.gitversion = None
+ self.gitcommit = None
+ self.projectversion = None
def print_versions(p, c, m, run_name):
vnodes, counts = _gather_vnodes(p, c, m, run_name)
@@ -20,8 +21,10 @@ def _vnode_report(vnodes, counts):
txt = "Only one source of version information:\n"
for version in vnodes[0].versions:
txt += " %s\n" % version
- if vnodes[0].gitversion:
- txt += " GIT: %s" % vnodes[0].gitversion
+ if vnodes[0].gitcommit:
+ txt += " GIT: %s" % vnodes[0].gitcommit
+ if vnodes[0].projectversion:
+ txt += " Project: %s" % vnodes[0].projectversion
return txt
keys = counts.keys()
@@ -33,6 +36,32 @@ def _vnode_report(vnodes, counts):
if counts[key] != 1:
txt += "s"
txt += "\n"
+
+ # Each combination of git + projectversion is treated as a unique package
+ # (This guards against any divergence in git commit vs. manual version bump.)
+ appv = {}
+ for vnode in vnodes:
+ tup = (vnode.projectversion, vnode.gitcommit)
+ if appv.has_key(tup):
+ appv[tup] += 1
+ else:
+ appv[tup] = 1
+
+ keys = appv.keys()
+ keys.sort()
+ toprints = []
+ for key in keys:
+ toprints.append("%s (git: %s)" % (key[0], key[1]))
+
+ widest = _widest_key(toprints)
+ txt += "\n\nApp versions from %d sources:\n" % len(vnodes)
+ for key in keys:
+ toprint = "%s (git: %s)" % (key[0], key[1])
+ txt += " %s %d occurence" % (_pad_txt(toprint, widest), appv[key])
+ if appv[key] != 1:
+ txt += "s"
+ txt += "\n"
+
return txt
def _widest_key(keys):
@@ -90,8 +119,10 @@ def _init_vnodes(allvms):
for key in ev.extra.keys():
if key == "depsource":
continue
- elif key == "gitversion":
- vnode.gitversion = ev.extra[key]
+ elif key == "gitcommit":
+ vnode.gitcommit = ev.extra[key]
+ elif key == "projectversion":
+ vnode.projectversion = ev.extra[key]
elif key.startswith("dep"):
dep = _filter_dep(ev.extra[key])
if dep:
Please sign in to comment.
Something went wrong with that request. Please try again.