Giter Site home page Giter Site logo

Comments (8)

seveas avatar seveas commented on September 28, 2024

Strange, I've never seen that. And when I use your XML output in debug mode, I also don't get an error. Which version of python (and if 2.4: which version of elementTree) are you using?

from python-hpilo.

seveas avatar seveas commented on September 28, 2024

Here's a debug version of hpilo.py with some code added that should spew info about the bogus value of 'message' (it's a list, should not be). Can you drop that in place of the existing hpilo.py and run your get_fw_version command?

from python-hpilo.

itd avatar itd commented on September 28, 2024

Thanks for looking at this! The output is below.

When I threw a debug in just under def _process_info_tag(self, message, returntags, process):
it looked like what was in message was not what was expected:

(Pdb) l
627
628         def _process_info_tag(self, message, returntags, process):
629
630             import pdb; pdb.set_trace()
631
632  ->         if isinstance(returntags, basestring):
633                 returntags = [returntags]
634
635             for tag in returntags:
636                 if message.find(tag) is None:
637                     continue
(Pdb) message
[<Element 'R\x00I\x00B' at 0x1c0fc50>, <Element 'R\x00I\x00B' at 0x1c0fd50>, <Element 'R\x00I\x00B' at 0x1c0fe50>, <Element 'R\x00I\x00B' at 0x1c0ff50>, <Element 'R\x00I\x00B' at 0x1c16090>, <Element 'R\x00I\x00B' at 0x1c16250>, <Element 'R\x00I\x00B' at 0x1c16350>]

Here's the output from the debug version of hpilo.py:

 $ hpilo_cli -dd 172.17.11.81  get_fw_version
Connecting to 172.17.11.81 port 443
Connecting to 172.17.11.81 port 443
Sending XML request, 132 bytes
POST /ribcl HTTP/1.1
Host: localhost
Content-Length: 52
Connection: Close


<?xml version="1.0"?>
<RIBCL VERSION="2.0"></RIBCL>
Received 424 bytes
HTTP/1.1 200 OK
Content-Type: text/xml
Transfer-Encoding: chunked
Cache-Control: no-cache
Connection: close
Date: Thu, 16 Jan 2014 19:42:07 GMT
Server: HP-iLO-Server/1.30

<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>

Connecting to 172.17.11.81 port 443
Connecting to 172.17.11.81 port 443
Sending XML request, 270 bytes
POST /ribcl HTTP/1.1
Host: localhost
Content-Length: 189
Connection: Close


<?xml version="1.0"?>
<RIBCL
 VERSION="2.0"
>
<LOGIN
 PASSWORD="********"
 USER_LOGIN="stats"
>
<RIB_INFO
 MODE="read"
>
<GET_FW_VERSION
 />
</RIB_INFO>
</LOGIN>
</RIBCL>

Received 1171 bytes
HTTP/1.1 200 OK
Content-Type: text/xml
Transfer-Encoding: chunked
Cache-Control: no-cache
Connection: close
Date: Thu, 16 Jan 2014 19:42:07 GMT
Server: HP-iLO-Server/1.30

<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
<GET_FW_VERSION
   FIRMWARE_VERSION = "1.30"
   FIRMWARE_DATE = "Jul 18 2013"
   MANAGEMENT_PROCESSOR = "iLO4"
   LICENSE_TYPE = "iLO 4 Standard"
    />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>
<?xml version="1.0"?>
<RIBCL VERSION="2.23">
<RESPONSE
    STATUS="0x0000"
    MESSAGE='No error'
     />
</RIBCL>

[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
[<Element 'R\x00I\x00B' at 0x2637c50>, <Element 'R\x00I\x00B' at 0x2637d50>, <Element 'R\x00I\x00B' at 0x2637e50>, <Element 'R\x00I\x00B' at 0x2637f50>, <Element 'R\x00I\x00B' at 0x263e090>, <Element 'R\x00I\x00B' at 0x263e250>, <Element 'R\x00I\x00B' at 0x263e350>]
Traceback (most recent call last):
  File "/home/kbendl/pyAPI/venv-hpilo/bin/hpilo_cli", line 267, in <module>
    main()
  File "/home/kbendl/pyAPI/venv-hpilo/bin/hpilo_cli", line 183, in main
    results = [getattr(ilo, method)(**params)]
  File "/home/kbendl/pyAPI/venv-hpilo/lib/python2.7/site-packages/hpilo.py", line 948, in get_fw_version
    return self._info_tag('RIB_INFO', 'GET_FW_VERSION')
  File "/home/kbendl/pyAPI/venv-hpilo/lib/python2.7/site-packages/hpilo.py", line 626, in _info_tag
    return self._process_info_tag(message, returntags or [tagname], process)
  File "/home/kbendl/pyAPI/venv-hpilo/lib/python2.7/site-packages/hpilo.py", line 633, in _process_info_tag
    if message.find(tag) is None:
AttributeError: 'list' object has no attribute 'find'
(venv-hpilo)

It seems that those Element objects are not what we're looking for. Any ideas?

-kb

from python-hpilo.

seveas avatar seveas commented on September 28, 2024

Ooh, a bunch of '\00's all over the place, as if it's undecoded UTF-16. How special is your python?

from python-hpilo.

itd avatar itd commented on September 28, 2024

Hmm... I have it running from a virtualenv based on an EPEL Python 2.7.4, but the base Python could have been jacked with. Let me try building a "clean" python binary in my project space and see if that renders anything differently.

from python-hpilo.

seveas avatar seveas commented on September 28, 2024

Can you try with stock (CentOS?) python? just copy hpilo.py and hpilo_cli to ~ and set PYTHONPATH appropriately.

from python-hpilo.

itd avatar itd commented on September 28, 2024

Holy guacamole! Great catch! It is the python build. I'm sorry to bother you with that. I thought it may have something to do with the rev of iLO4 we are using. I'll let the scientists know their build is hosed. Thanks a million!

from python-hpilo.

seveas avatar seveas commented on September 28, 2024

No worries. I'm guessing they're doing a ucs-4 build of python and cElementTree is built ucs-2. That gives you strings that don't like each other. Good luck getting to the bottom of this!

from python-hpilo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.