Ticket #1115 (closed defect: fixed)
ProbeData object doesn't behave like a str() anymore
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawkfar6gGD3PuUixQdEZQyRr2mpowLW1A70 | Owned by: | desai |
---|---|---|---|
Priority: | major | Milestone: | Bcfg2 1.3.0 Release |
Component: | bcfg2-client | Version: | 1.0 |
Keywords: | Probe | Cc: |
Description
In testing my migration to 1.2.x I've noticed I can no longer treat probe data as a string:
len(metadata.Probes.get('system-memory'))
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError?: object of type 'ProbeData?' has no len()
or
'104' in metadata.Probes.get('system-memory')
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError?: argument of type 'ProbeData?' is not iterable
There is a string at .data but due to the way I test that an object is populated with .get('probe_name', 'default'), this makes it hard to get at the data.
Can the ProbeData? please inherit the properties of a str() object?
Attachments
Change History
comment:2 Changed 11 years ago by solj
- Milestone changed from Bcfg2 1.2.3 Release (Bugfix) to Bcfg2 1.3.0 Release
comment:3 Changed 11 years ago by https://www.google.com/accounts/o8/id?id=AItOawnSjgovXZr-_V3vGkvMSR0pc5LDykRc1Nc
- Status changed from new to closed
- Resolution set to fixed
Fixed in https://github.com/Bcfg2/bcfg2/commit/7480e8f11d991b75fe5ece33323734451defc7bd and a few related commits.
Moving to 1.3