On 07/15/2015 04:16 PM, David Smith wrote:
> On 07/15/2015 01:55 AM, Nathan Scott wrote:
>> Hi David,
>>
>> ----- Original Message -----
>>> [...]
>>> I've scratched my head over this for a good bit of today, and I finally
>>> figured it out. RHEL6 has python 2.6. The json.load() function in python
>>> 2.6 doesn't support the 'object_pairs_hook' which the json pmda uses. I
>>> haven't found a fix or workaround yet.
>>
>> Any thoughts on this one since then? (not sure it was communicated, but
>> end result of this was Dave needed to switch pmdajson off in EL6 builds).
>
> Right, I figured that switching pmdajson off would be the case for EL6.
> For the record, we've got 3 (known) problems using the JSON PMDA with
> python 2.6.
>
> 1) "json.load" syntax error. This one is fairly minor, and might be
> fixed by switching to another one of the python json implementations or
> just removing the use of OrderedDicts. They were very helpful during
> development, since I was always processing JSON items in the order they
> were present in the input file, instead of in some semi-random order.
I worked with this problem, and after some trial and error, decided to
remove the use of OrderedDicts. Commit
dc60f3389b1b86606b39a92d11164900e507cebc on the dsmith/dev pcpfans.git
branch fixes this problem. This same fix seems work also work on python
2.7+.
> 2) "six" module missing in RHEL6. This one is actually fairly minor. The
> "six" module is for python 2-to-3 compatibility. We could fix this by
> copying the fairly small parts of the six module we actually use into
> the python pmda. Another option would be to have 2 different versions of
> the python JSON pmda available, one for 2.6 and one for 2.7+.
It appears I was wrong here. The python-six rpm is available on RHEL6
(perhaps it got added to one of the later 6.X releases?
====
# yum list avail python-six
...
Installed Packages
python-six.noarch 1.9.0-2.el6 @rhel-x86_64-server-6
====
> 3) "jsonpointer" module missing in RHEL6. This is the major one, and the
> reason I didn't bother working on 1) and 2). We could fix this at least
> 3 different ways I can think of: a) get the python-jsonpointer package
> into RHEL6, b) bundle the python-jsonpointer module with pcp for python
> 2.6, or c) get pcp and the python-jsonpointer module into DTS and ask RH
> customers who really want to use the JSON support use the DTS versions.
> This one is really a distro problem, anyone building from source
> themselves can obviously install anything they want.
The python-jsonpointer rpm is still only available in EPEL, as far as I
know.
--
David Smith
dsmith@xxxxxxxxxx
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
|