-
Notifications
You must be signed in to change notification settings - Fork 17
Update pycrypto to pycryptodome in setup.py #17
New issue
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
base: main
Are you sure you want to change the base?
Conversation
@SchoolGuy , this is what you want, right? can you test it? |
@DaanHoogland Yes, that is what I want. Is there no automatic testsuite that can verify that this change is working as desired? |
No it is mainly a testtool for integration tests in Apache CloudStack . It doesn’t get much TLC on its own :( |
I'll see what I can do. What is the minimum required Python version I need to test with? I am aware that Apache CloudStack is used in an enterprise context and, as such, probably needs more than the most recent Python version. |
@SchoolGuy , we have upgraded most scripts to python3 but have no specific version requirement as far as I know. Any not too old version should do. it runs with so many operating systems that we cannot be specific about the versions of runtime elements. ad. there should be no 2.x python scripts left. |
@DaanHoogland So I have used an openSUSE Leap 15.6 podman container with Python 3.6.15 and the last available pycryptodome version is 3.21.0. Furthermore, I noticed that the readme is stating how to replace pycrypto with pycryptodome, this section is either incomplete (as you need to break the deps on purpose) or we should remove it in this PR. Another thing that I noticed in the README is that using Finally, I am unable to test the code because of a cryptic error that I cannot decipher, even by reading the source code. The command I used to verify the server:
Server Output:
bmc.py: #!/usr/bin/python3
import logging
import signal
import socketserver
import sys
import threading
from types import FrameType
from typing import Optional
# https://github.com/shapeblue/ipmisim/issues/16
from ipmisim.ipmisim import IpmiServer, ThreadedIpmiServer, IpmiServerContext # type: ignore
logger = logging.getLogger('ipmisim')
def main(address: str = "0.0.0.0", port: int = 9001):
logging.disable(logging.NOTSET)
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
port = 9001
ctx = IpmiServerContext()
try:
ThreadedIpmiServer.allow_reuse_address = True
server = ThreadedIpmiServer(('0.0.0.0', port), IpmiServer)
logger.info("Started IPMI Server on 0.0.0.0:" + str(port))
server.serve_forever()
except KeyboardInterrupt:
server.shutdown()
server.server_close()
sys.exit(0)
if __name__ == "__main__":
main() |
@SchoolGuy , I see but can not explain it as the root cause the following: python 3.6 is no longer supported. Can you install and try a newer python version? I will have to investigate the stacktrace (no field port in object for IpmiServerContext) but at first glance you should add the port to the ctx object. |
@DaanHoogland But Python 3.6 is supported until 2038 at least in SUSE Linux Enterprise Server. Other Linux enterprise distros have this as their default as well, if I am informed correctly. I will very happily use a more recent Python version, but then I would highly recommend documenting this for the entirety of the CloudStack project (I didn't find the info in the Developer Confluence or the building from source section of the installation documentation). |
Testing with Python 3.11 (latest available on Leap 15.6), I get the same results. Furthermore, I now have a bunch of warnings:
|
I was looking at this line ^ With the newer version we obviously have other work to do. Not sure when, but I’ll have a go at it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test but LGTM,
FWIW this was mentioned in the docs https://github.com/shapeblue/ipmisim?tab=readme-ov-file#ipmisim
Fixes #15