Bug 1264147 - RFE: Python pmFetch needs to become polymorphic
Summary: RFE: Python pmFetch needs to become polymorphic
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: pcp
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nathan Scott
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-17 15:38 UTC by Marko Myllynen
Modified: 2016-07-19 17:55 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-19 17:55:30 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Marko Myllynen 2015-09-17 15:38:07 UTC
Description of problem:
The below is from pcp2graphite.py but would be needed in other Python applications as well:

...
    # Convert a python list of pmids (numbers) to a ctypes LP_c_uint (a C array of uints).
    def convert_pmids_to_ctypes(self, pmids):
        import ctypes
        from ctypes import c_uint
        pmidA = (c_uint * len(pmids))()
        for i,p in enumerate(pmids):
            pmidA[i] = c_uint(p)
        return pmidA
...

        pmid = self.context.pmLookupName(name)[0]
        self.pmids.append(pmid)

        # NB: we'd like to do: result = self.context.pmFetch(self.pmids)
        # But: pmFetch takes ctypes array-of-uint's, not a python list.  It needs to become polymorphic.
        result = self.context.pmFetch(self.convert_pmids_to_ctypes(self.pmids))
...

Version-Release number of selected component (if applicable):
3.10.7

Comment 1 Fedora End Of Life 2016-07-19 17:55:30 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.