fence_aliyun fails on RHEL 8 with "NameError: name 'client' is not defined"
Environment
- Red Hat Enterprise Linux (RHEL) 8 with the High Availability Add-on
- Alibaba Cloud (Aliyun)
Issue
fence_aliyuncommands fail on RHEL 8 with "NameError: name 'client' is not defined".
[root@rhel-8-node1 ~]# fence_aliyun -r us-west-1 -a <access_key> -s <secret_key> -o list
Traceback (most recent call last):
File "/usr/sbin/fence_aliyun", line 160, in <module>
main()
File "/usr/sbin/fence_aliyun", line 152, in main
conn = client.AcsClient(access_key, secret_key, region)
NameError: name 'client' is not defined
Resolution
Red Hat Enterprise Linux 8.0
Upgrade to [`fence-agents-aliyun-4.2.1-17.el8_0.3`](/errata/RHBA-2019:1526) or later.
Red Hat Enterprise Linux 8.1 or later
Upgrade to [`fence-agents-aliyun-4.2.1-30.el8`](/errata/RHBA-2019:3326) or later.
Root Cause
The fence_aliyun fence agent was written for Python2. Module names and module search paths have changed in Python3. RHEL 8 only ships Python3, so the fence agent fails due to missing modules.
SBR
Product(s)
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.