Bug 1473908 - fence_apc_snmp.py error on python3.6
Summary: fence_apc_snmp.py error on python3.6
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: fence-agents
Version: 26
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Marek Grac
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-22 09:46 UTC by Kristian Feldsam
Modified: 2017-08-07 17:19 UTC (History)
2 users (show)

Fixed In Version: fence-agents-4.0.24-7.fc26
Clone Of:
Environment:
Last Closed: 2017-08-07 17:19:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs fence-agents issues 132 0 None closed fence_apc_snmp.py error on python3 2020-11-09 09:49:44 UTC

Description Kristian Feldsam 2017-07-22 09:46:20 UTC
Description of problem:

fence_apc_snmp crash

Version-Release number of selected component (if applicable):
4.0.24-6.fc26

How reproducible:
just try to get status of outlet `fence_apc_snmp --ip=192.168.2.2 --snmp-version=2c --community=private --plug=8 --action=status`

Steps to Reproduce:
1.
2.
3.

Actual results:
Traceback (most recent call last):
      File "./fence_apc_snmp.py", line 224, in <module>
        main()
      File "./fence_apc_snmp.py", line 220, in main
        result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)
      File "/usr/share/fence/fencing.py", line 780, in fence_action
        outlets = get_outlet_list(connection, options)
      File "./fence_apc_snmp.py", line 172, in get_outlets_status
        apc_set_device(conn)
      File "./fence_apc_snmp.py", line 114, in apc_set_device
        apc_type = conn.walk(OID_SYS_OBJECT_ID)
      File "/usr/share/fence/fencing_snmp.py", line 132, in walk
        output = self.run_command(cmd, additional_timemout).splitlines()
      File "/usr/share/fence/fencing_snmp.py", line 100, in run_command
        if (res_code != 0) or (re.search("^Error ", res_output, re.MULTILINE) != None):
      File "/usr/lib64/python3.6/re.py", line 182, in search
        return _compile(pattern, flags).search(string)
    TypeError: cannot use a string pattern on a bytes-like object

Expected results:
Status: OFF/ON

Additional info:
I alredy fixed this, check my pull request https://github.com/ClusterLabs/fence-agents/pull/133

Comment 1 Oyvind Albrigtsen 2017-07-27 12:21:44 UTC
New patch to solve this issue for all agents that use pexpect:
https://github.com/ClusterLabs/fence-agents/pull/135

Agents using the subprocess method arent affected by the issue.

Comment 2 Fedora Update System 2017-07-27 14:14:12 UTC
fence-agents-4.0.24-7.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-49bb75e66e

Comment 3 Fedora Update System 2017-07-29 00:53:20 UTC
fence-agents-4.0.24-7.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-49bb75e66e

Comment 4 Fedora Update System 2017-08-07 17:19:35 UTC
fence-agents-4.0.24-7.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.