Better output for OpenSSH patch-level.

This commit is contained in:
Andris Raugulis 2016-09-08 14:06:36 +03:00
parent 6d402819cb
commit b8effe1462

View File

@ -242,8 +242,14 @@ class SSH(object):
out += self.product out += self.product
if self.version: if self.version:
out += ' {0}'.format(self.version) out += ' {0}'.format(self.version)
if self.patch: patch = self.patch
out += ' {0}'.format(self.patch) if self.product == 'OpenSSH':
mx = re.match('^(p\d)(.*)$', self.patch)
if mx is not None:
out += mx.group(1)
patch = mx.group(2).strip()
if patch:
out += ' ({0})'.format(self.patch)
if self.os: if self.os:
out += ' running on {0}'.format(self.os) out += ' running on {0}'.format(self.os)
return out return out