Hi, this is syntax problem when using python3. I already try run command directly with output

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


S pozdravom / Best regards Feldsam
Tel.: +420 773 303 353

www.feldsam.cz - webdesign, webdeveloping, webhosting


Address: Praha 4 - Libus, V rohu 434/4, ZIP 142 00

On 21 Jul 2017, at 20:09, Digimer <lists@alteeve.ca> wrote:

On 2017-07-21 01:38 PM, Kristián Feldsam wrote:
primitive fence_node3_pdu1 stonith:fence_apc_snmp \
       params pcmk_host_list=node3.feldhost.cz ipaddr=192.168.2.1
login=node passwd=somepass port=5 \
       op monitor interval=60
primitive fence_node3_pdu2 stonith:fence_apc_snmp \
       params pcmk_host_list=node3.feldhost.cz ipaddr=192.168.2.2
login=node passwd= somepass power_wait=5 port=5 \
       op monitor interval=60

From both nodes, at the command line, can you run;

fence_apc_snmp -a 192.168.2.1 -l node -p somepass -n 5 -o status
fence_apc_snmp -a 192.168.2.1 -l node -p somepass -n 6 -o status

In my experience, you don't need to specify the username and password by
default on APC switched PDUs.


--
Digimer
Papers and Projects: https://alteeve.com/w/
"I am, somehow, less interested in the weight and convolutions of
Einstein’s brain than in the near certainty that people of equal talent
have lived and died in cotton fields and sweatshops." - Stephen Jay Gould