diff --git a/xCAT-openbmc-py/lib/python/agent/agent.py b/xCAT-openbmc-py/lib/python/agent/agent.py index 6afdefea8..3b70d5811 100755 --- a/xCAT-openbmc-py/lib/python/agent/agent.py +++ b/xCAT-openbmc-py/lib/python/agent/agent.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- encoding: utf-8 -*- from __future__ import print_function import argparse diff --git a/xCAT-openbmc-py/lib/python/agent/client.py b/xCAT-openbmc-py/lib/python/agent/client.py index ff2188e9e..30322a4a6 100755 --- a/xCAT-openbmc-py/lib/python/agent/client.py +++ b/xCAT-openbmc-py/lib/python/agent/client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # just for test from __future__ import print_function diff --git a/xCAT-openbmc-py/lib/python/agent/common/exceptions.py b/xCAT-openbmc-py/lib/python/agent/common/exceptions.py index ba135d177..463775cd2 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/exceptions.py +++ b/xCAT-openbmc-py/lib/python/agent/common/exceptions.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 class SelfServerException(Exception) : def __init__(self, message, detail_msg= "", host_and_port="") : diff --git a/xCAT-openbmc-py/lib/python/agent/common/rest.py b/xCAT-openbmc-py/lib/python/agent/common/rest.py index 54fb5b4eb..95b3b9589 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/rest.py +++ b/xCAT-openbmc-py/lib/python/agent/common/rest.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/common/task.py b/xCAT-openbmc-py/lib/python/agent/common/task.py index 1f93cab0e..021ea95cd 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/task.py +++ b/xCAT-openbmc-py/lib/python/agent/common/task.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/common/utils.py b/xCAT-openbmc-py/lib/python/agent/common/utils.py index bdbfba23e..3306649ad 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/utils.py +++ b/xCAT-openbmc-py/lib/python/agent/common/utils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/beacon.py b/xCAT-openbmc-py/lib/python/agent/hwctl/beacon.py index 0c4cb6672..ec24ee858 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/beacon.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/beacon.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/bmcconfig.py index 76355be85..b29665638 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/bmcconfig.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/eventlog.py index 0c8f6378d..a17d1e94c 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/eventlog.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/eventlog.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py index ab82062b4..353768ee6 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/flash.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py index 041c29b93..517235628 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/inventory.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py index b22170fff..b8c9468af 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_beacon.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py index 902858229..56da82f99 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py index 65b29f230..eacb2728c 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_eventlog.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py index 59e0f4153..bd39d2ddf 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_flash.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py index fbf02c12f..0146c5e9b 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_inventory.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py index b6bc0b4e4..0364b6ac3 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_power.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py index 24d041912..ecdaa103e 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_sensor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py index 3a6b5ba1b..b7674061a 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_setboot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index fe9640919..e8994e513 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/power.py index 84b59ab99..839f42d84 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/power.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py index 00325b994..7d74401cb 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_power.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py index d80f9515a..8a3282b16 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish/redfish_setboot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py index 0900f63bf..ae0871914 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/redfish_client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py b/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py index e70e45c4e..09f9c2de9 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/sensor.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/setboot.py b/xCAT-openbmc-py/lib/python/agent/hwctl/setboot.py index d45ae34e7..3a0a49a11 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/setboot.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/setboot.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py index 0318531c8..1d4958d8d 100644 --- a/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py +++ b/xCAT-openbmc-py/lib/python/agent/tests/unit/test_hwctl/test_redfish_client.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py index c01884876..15b8631b0 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/openbmc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py index 1d66178ab..6a2c48db6 100644 --- a/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py +++ b/xCAT-openbmc-py/lib/python/agent/xcatagent/redfish.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 ############################################################################### # IBM(c) 2018 EPL license http://www.eclipse.org/legal/epl-v10.html ############################################################################### diff --git a/xCAT-openbmc-py/xCAT-openbmc-py.spec b/xCAT-openbmc-py/xCAT-openbmc-py.spec index 36f9342e9..563b34a2a 100644 --- a/xCAT-openbmc-py/xCAT-openbmc-py.spec +++ b/xCAT-openbmc-py/xCAT-openbmc-py.spec @@ -18,10 +18,10 @@ AutoReqProv: no BuildArch: noarch Requires: xCAT-server -Requires: python-gevent >= 1.2.2-2 -Requires: python-greenlet >= 0.4.13-2 -Requires: python-paramiko >= 2.0.0 -Requires: python2-docopt python-requests python-scp +Requires: python3-gevent +Requires: python3-greenlet +Requires: python3-paramiko +Requires: python3-docopt python3-requests python3-scp %description xCAT-openbmc-py provides openbmc related functions. diff --git a/xCAT-test/autotest/testcase/pythonsupport/cases0 b/xCAT-test/autotest/testcase/pythonsupport/cases0 index 38a0eb05d..583952692 100644 --- a/xCAT-test/autotest/testcase/pythonsupport/cases0 +++ b/xCAT-test/autotest/testcase/pythonsupport/cases0 @@ -1,5 +1,5 @@ start:set_up_env_for_support_openbmc_in_python -description:this case is used to test environment setup for supporting openbmc in python +description:this case is used to test environment setup for supporting openbmc in python on RH7 label:others,hctrl_openbmc os:Linux hcp:openbmc,kvm @@ -30,15 +30,31 @@ cmd:sed -i "s|__REPLACE_PATH__EXTRAS__|$$PYTHON_DEP_EXTRAS_DIR|g" /etc/yum.repos check:rc==0 cmd:sed -i "s|__REPLACE_PATH__FED__|$$PYTHON_DEP_FED_DIR|" /etc/yum.repos.d/xcat-dep-python-local.repo check:rc==0 -cmd: cat /etc/yum.repos.d/xcat-dep-python-local.repo +cmd:cat /etc/yum.repos.d/xcat-dep-python-local.repo +check:rc==0 +cmd:wget https://xcat.org/files/xcat/xcat-dep/2.x_Linux/beta/xCAT-openbmc-py-RH7-2.14.6-snap202204090016.noarch.rpm -O /tmp/xCAT-openbmc-py-RH7.noarch.rpm +cmd:ls -l /tmp/xCAT-openbmc-py-RH7-2.14.6.rpm check:rc==0 -cmd:yum install -y xCAT-openbmc-py +cmd:yum install -y /tmp/xCAT-openbmc-py-RH7.noarch.rpm check:rc==0 -cmd:rpm -qa|grep "^xCAT-openbmc-py" -check:output=~ xCAT-openbmc-py-\d +cmd:rpm -qa|grep "^xCAT-openbmc-py-RH7" +check:output=~ xCAT-openbmc-py-RH7\d check:rc==0 cmd:rm -rf /tmp/set_up_env_for_support_openbmc_in_python check:rc==0 end +start:set_up_env_for_RH8_support_openbmc_in_python +description:this case is used to test environment setup for supporting openbmc in python on RH8 +label:others,hctrl_openbmc +os:Linux +hcp:openbmc,kvm +cmd:yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm +check:rc==0 +cmd:yum install -y xCAT-openbmc-py +check:rc==0 +cmd:rpm -qa|grep "^xCAT-openbmc-py" +check:output=~ xCAT-openbmc-py-\d +check:rc==0 +end