MCPcopy
hub / github.com/jtesta/ssh-audit / display

Method display

src/ssh_audit/software.py:109–125  ·  view source on GitHub ↗
(self, full: bool = True)

Source from the content-addressed store, hash-verified

107 return True
108
109 def display(self, full: bool = True) -> str:
110 r = '{} '.format(self.vendor) if bool(self.vendor) else ''
111 r += self.product
112 if bool(self.version):
113 r += ' {}'.format(self.version)
114 if full:
115 patch = self.patch or ''
116 if self.product == Product.OpenSSH:
117 mx = re.match(r'^(p\d)(.*)$', patch)
118 if mx is not None:
119 r += mx.group(1)
120 patch = mx.group(2).strip()
121 if bool(patch):
122 r += ' ({})'.format(patch)
123 if bool(self.os):
124 r += ' running on {}'.format(self.os)
125 return r
126
127 def __str__(self) -> str:
128 return self.display()

Callers 8

__str__Method · 0.95
test_openssh_softwareMethod · 0.80
test_libssh_softwareMethod · 0.80
test_hp_ilo_softwareMethod · 0.80
test_cisco_softwareMethod · 0.80
output_recommendationsFunction · 0.80

Calls

no outgoing calls

Tested by 6

test_openssh_softwareMethod · 0.64
test_libssh_softwareMethod · 0.64
test_hp_ilo_softwareMethod · 0.64
test_cisco_softwareMethod · 0.64