Takes a (str) containing a serialized protobuf as argument. Establishes a socket connection with PiSCSI.
(self, payload)
| 23 | super().__init__(host, port) |
| 24 | |
| 25 | def send_pb_command(self, payload): |
| 26 | """ |
| 27 | Takes a (str) containing a serialized protobuf as argument. |
| 28 | Establishes a socket connection with PiSCSI. |
| 29 | """ |
| 30 | try: |
| 31 | return super().send_pb_command(payload) |
| 32 | except FailedSocketConnectionException as err: |
| 33 | # After failing all attempts, throw a 404 error |
| 34 | abort( |
| 35 | 404, |
| 36 | _( |
| 37 | "The PiSCSI Web Interface failed to connect to PiSCSI at " |
| 38 | "%(host)s:%(port)s with error: %(error_msg)s. The PiSCSI " |
| 39 | "process is not running or may have crashed.", |
| 40 | host=self.host, |
| 41 | port=self.port, |
| 42 | error_msg=str(err), |
| 43 | ), |
| 44 | ) |
| 45 | return None |
| 46 | |
| 47 | def send_over_socket(self, sock, payload): |
| 48 | """Sends a payload over a given socket""" |
nothing calls this directly
no outgoing calls
no test coverage detected