MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / get_feature_status

Method get_feature_status

server_capabilities.py:266–277  ·  view source on GitHub ↗

Get status of all advanced features

(self)

Source from the content-addressed store, hash-verified

264 self.capabilities.hostname = platform.node()
265 self.capabilities.os_name = platform.system()
266 self.capabilities.os_version = platform.release()
267 self.capabilities.kernel_version = platform.version()
268
269 # Common locations a package-manager install drops binaries, checked when
270 # they aren't on PATH — a systemd service can run with a thin PATH that
271 # misses /usr/bin, which would hide an apt-installed nmap.
272 _TOOL_BIN_DIRS = ('/usr/bin', '/usr/local/bin', '/usr/sbin', '/bin',
273 '/sbin', '/snap/bin')
274
275 @classmethod
276 def _tool_present(cls, tool_name):
277 """True if `tool_name` is on PATH or in a common bin dir."""
278 if shutil.which(tool_name):
279 return True
280 return any(os.path.exists(os.path.join(d, tool_name))

Callers 2

Calls 1

getMethod · 0.45

Tested by

no test coverage detected