waldirio / hbi-axe

5 stars 4 forks source link

support python2 #8

Open matt8754 opened 3 years ago

matt8754 commented 3 years ago

Most of the times, people run this script on Satellite servers which do not have python3. It would be great if we can have this script support python2.

waldirio commented 3 years ago

Hey @matt8754

Thanks for the heads up, python3 is already present on satellite 6.9 if I'm not wrong, but I got your point.

I'll check this ASAP, maybe supporting both versions and will figure out during the runtime which is. I'll keep you posted.

Thank you!! Waldirio

waldirio commented 3 years ago

Hey @matt8754

There are two ways we could proceed here

  1. duplicate this code and change the second one in order to support python2 or
  2. check the python3 in the customer environment

Talking about the first one, p2 is not updated anymore and soon we will be seeing the python 4 coming :-). At this moment, python 2 is not recommended in any way for new development.

Talking about the second one, there are two ways to run this code, can be on satellite server itself or in any external machine (fedora, centos, rhel client), so, it's not required to be executed on satellite itself.

Checking on satellite, I've some versions available and let me show you, the default satellite installation for any reason was as below

with no python 3 6.5, 6.6, 6.8

with python 3 6.7, 6.9

so, installing python 3 on 6.5, 6.6 and 6.8 asked for install only 5 packages and after that, restarting satellite, everything seems right

Installing:
 python3                                                      x86_64                                           3.6.8-18.el7                                                rhel-7-server-rpms                                            70 k
Installing for dependencies:
 libtirpc                                                     x86_64                                           0.2.4-0.16.el7                                              rhel-7-server-rpms                                            89 k
 python3-libs                                                 x86_64                                           3.6.8-18.el7                                                rhel-7-server-rpms                                           6.9 M
 python3-pip                                                  noarch                                           9.0.3-8.el7                                                 rhel-7-server-rpms                                           1.6 M
 python3-setuptools                                           noarch                                           39.2.0-10.el7                                               rhel-7-server-rpms                                           629 k

Also, if the satellite has no python 3, the customer can use any content host or Linux desktop to run it as well.

Please, let me know what you think! Until now, I didn't see any customer that was unable to run it because of the absence of python3, indeed, I got a customer without p3 on satellite but he jumped in a content host with p3 and there we are, running the code with no problem.

Thank you!! Waldirio