We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using python 3.12 and a remote client for lxd, I hit a problem with the ws4py package:
ws4py
AttributeError Traceback (most recent call last) Cell In[2], line 5 3 client = pylxd.Client(endpoint="https://localhost:8443") 4 instances = client.instances.all() ----> 5 instances[0].execute(["cat", "/etc/os-release"]) File ~/.local/share/virtualenvs/pylxd-yXHR9QOr/lib/python3.12/site-packages/pylxd/models/instance.py:475, in Instance.execute(self, commands, environment, encoding, decode, stdin_payload, stdin_encoding, stdout_handler, stderr_handler, user, group, cwd) 469 stdin = _StdinWebsocket( 470 self.client.websocket_url, 471 payload=stdin_payload, 472 encoding=stdin_encoding, 473 ) 474 stdin.resource = f"{parsed.path}?secret={fds['0']}" --> 475 stdin.connect() 476 stdout = _CommandWebsocketClient( 477 manager, 478 self.client.websocket_url, (...) 481 handler=stdout_handler, 482 ) 483 stdout.resource = f"{parsed.path}?secret={fds['1']}" File ~/.local/share/virtualenvs/pylxd-yXHR9QOr/lib/python3.12/site-packages/ws4py/client/__init__.py:214, in WebSocketBaseClient.connect(self) 208 """ 209 Connects this websocket and starts the upgrade handshake 210 with the remote endpoint. 211 """ 212 if self.scheme == "wss": 213 # default port is now 443; upgrade self.sender to send ssl --> 214 self.sock = ssl.wrap_socket(self.sock, **self.ssl_options) 215 self._is_secure = True 217 self.sock.connect(self.bind_addr) AttributeError: module 'ssl' has no attribute 'wrap_socket'
First, make sure you are using python version 3.12, then add localhost to lxc remote, changing the password to mirror your local installation:
lxc remote add localhost --accept-certificate --password an-incredibly-secure-password
Spin up a virtual machine, then try to communicate using the endpoint:
import pylxd client = pylxd.Client(endpoint="https://localhost:8443") instances = client.instances.all() instances[0].execute(["cat", "/etc/os-release"])
Given Lawouach/WebSocket-for-Python#283 the most likely boils down to updating ws4py dependency.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The issue
Using python 3.12 and a remote client for lxd, I hit a problem with the
ws4py
package:Steps to reproduce
First, make sure you are using python version 3.12, then add localhost to lxc remote, changing the password to mirror your local installation:
Spin up a virtual machine, then try to communicate using the endpoint:
Possible solution
Given Lawouach/WebSocket-for-Python#283 the most likely boils down to updating
ws4py
dependency.The text was updated successfully, but these errors were encountered: