| To: | Martins Innus <minnus@xxxxxxxxxxx> |
|---|---|
| Subject: | Re: [pcp] Python pmda instances |
| From: | Nathan Scott <nathans@xxxxxxxxxx> |
| Date: | Sun, 15 Feb 2015 19:00:26 -0500 (EST) |
| Cc: | PCP Mailing List <pcp@xxxxxxxxxxx> |
| Delivered-to: | pcp@xxxxxxxxxxx |
| In-reply-to: | <54DE51A0.7070905@xxxxxxxxxxx> |
| References: | <54DE51A0.7070905@xxxxxxxxxxx> |
| Reply-to: | Nathan Scott <nathans@xxxxxxxxxx> |
| Thread-index: | s3EkKQ/r0rgIFexBEZajpO8qmZzNEw== |
| Thread-topic: | Python pmda instances |
Hi Martins, ----- Original Message ----- > [...] > LIBPCP_PMDA.pmdaCacheStore(indom, cpmda.PMDA_CACHE_ADD, key, > byref(insts[key])) > TypeError: byref() argument must be a ctypes instance, not 'dict' > > I can work around this by just storing an index instead, but I don't > know enough about python to know if there is a way to make that cast work. We're using the python ctypes module extensively in our PMDA (and PMAPI) library wrappers. To store into the pmdaCache pointers, we need to use something that is a subclass of a ctypes class, usually "Structure", so that the reference counting and type checking is done correctly (IIRC). See src/pmdas/dmcache and/or src/pmdas/gluster PMDAs for example PMDAs that use python pmdaCache-tracked objects. cheers. -- Nathan |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [Bug 1104] signal delivery may lead to deadlock, bugzilla-daemon |
|---|---|
| Next by Date: | pcp updates: pmdalinux fix + kenj merge, Nathan Scott |
| Previous by Thread: | Python pmda instances, Martins Innus |
| Next by Thread: | pcp updates: scox: qa 752 (next TODAY), Dave Brolley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |