Comments (8)
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.
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.
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.
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.
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.
Can you try with stock (CentOS?) python? just copy hpilo.py and hpilo_cli to ~
and set PYTHONPATH appropriately.
from python-hpilo.
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.
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)
- ilo2 / ilo3 ssl unsupported protocol
- From Ansible, when targeting iLO version 5, only hw_eth0 and hw_eth_ilo show details, missing all other hw_ethX. HOT 1
- hpilo 4.4.3 : iLO2 : XML or text declaration not at start of entity: line 2, column 0
- HP download site seems to be missing intermediate certs.
- HPE Smart Array version details displayling null using latest version 4.4.3.
- [feature] Add ability to connect to ILO over HTTPS proxy
- Outdated COMPAQ (HP) iLO v2 sslv3 (tls1/aes-128) issue HOT 1
- Support for roles and/or new privileges gen10/ilo5 HOT 1
- (Debian) how to run tests
- get_one_time_boot not work
- python-hpilo can't connect anymore to an iLO2 server on python3.10 HOT 13
- EPEL 8 & 9 Package Maintainers Needed HOT 1
- missing BIOS setting feature
- hponcfg is being deprecated by HPE
- iLoError not clear after 100% download completion from hpilo_cli HOT 2
- Remove IRS Direct Connect functionality, as it has been discontinued.
- ilo6 compatibility HOT 2
- Some Python2 code still in hpilo_cli file
- hpilo_cli: cannot execute: required file not found
- Compatibility issues with Python3.12: SSL: WRONG_SIGNATURE_TYPE HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-hpilo.