Bug 1473908 - fence_apc_snmp.py error on python3.6
fence_apc_snmp.py error on python3.6
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: fence-agents (Show other bugs)
26
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: Marek Grac
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-22 05:46 EDT by Kristian Feldsam
Modified: 2017-08-07 13:19 EDT (History)
2 users (show)

See Also:
Fixed In Version: fence-agents-4.0.24-7.fc26
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-07 13:19:35 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github ClusterLabs/fence-agents/issues/132 None None None 2017-07-22 05:47 EDT

  None (edit)
Description Kristian Feldsam 2017-07-22 05:46:20 EDT
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 08:21:44 EDT
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 10:14:12 EDT
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-28 20:53:20 EDT
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 13:19:35 EDT
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.