MCPcopy Index your code
hub / github.com/NyarchLinux/DesktopPuppet / is_connected

Method is_connected

src/gui_controller.py:25–33  ·  view source on GitHub ↗

Check if the puppet API is reachable.

(self)

Source from the content-addressed store, hash-verified

23 self._connected = False
24
25 def is_connected(self):
26 """Check if the puppet API is reachable."""
27 try:
28 response = requests.get(f"{self.base_url}/expressions", timeout=1)
29 self._connected = response.status_code == 200
30 return self._connected
31 except requests.RequestException:
32 self._connected = False
33 return False
34
35 def get_expressions(self):
36 """Get available expressions from the puppet."""

Callers 1

monitorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected