seveas / python-hpilo

Accessing the HP iLO XML interface from python

Home Page:https://seveas.github.io/python-hpilo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ILO passwords with double quotes cause error

neilmunday opened this issue · comments

If the ILO password has double quotes in it, then hpilo_cli fails with a syntax error:

Traceback (most recent call last):
  File "/opt/python-hpilo-4.3/hpilo_cli", line 334, in <module>
    main()
  File "/opt/python-hpilo-4.3/hpilo_cli", line 214, in main
    results = [getattr(ilo, method)(**params)]
  File "/opt/python-hpilo-4.3/hpilo.py", line 1385, in import_certificate
    return self._control_tag('RIB_INFO', 'IMPORT_CERTIFICATE', text=certificate)
  File "/opt/python-hpilo-4.3/hpilo.py", line 760, in _control_tag
    header, message = self._request(root)
  File "/opt/python-hpilo-4.3/hpilo.py", line 253, in _request
    message = self._parse_message(data)
  File "/opt/python-hpilo-4.3/hpilo.py", line 615, in _parse_message
    raise IloError(message, status)
hpilo.IloError: Error: Line #1: syntax error near ""Pass"".. You may have tried to use a feature this iLO version or firmware version does not support.

Looking at the XML passed in the debug output the following is seen:

<?xml version="1.0"?>
<RIBCL VERSION="2.0"><LOGIN PASSWORD="********"XXXX" USER_LOGIN="Administrator">

Yeah, that's because the ilo's don't properly escape everything when the generate XML, so this will make them generate invalid xml. Unfortunately, the best solution here is to not use double quotes in passwords.