[Zenoss-dev] Re: lookupSchema
Erik A. Dahl
edahl at zenoss.com
Tue Mar 4 12:02:52 EST 2008
I can dive into the details of making a relationship with you but
before we get too far I think you need to take a look at the DeviceHW
harddisks relationship. I think that's what you are looking for. In
the modeler look at the InformantHardDiskMap.py for an example of how
to map the object. Your path should be something like.
device.hw.harddisks.sd0
-EAD
On Mar 4, 2008, at 11:40 AM, lazabba wrote:
> Yes I've seen it done this way.
> But somehow I do not like it, so I figured out a different way - as
> above. Seems to work.
>
> It also looks like_createRelObject from ApplyDataMap called during
> zenmodelling should be able to fix some relations if they do not
> exist. But I haven't made attempts to verify how and why.
>
>
> A.
>
>
>
> ecn wrote:
>> Ahhh. Ok.
>>
>> Here's a basic outline of what you need to do.
>>
>>
>> Add an entry to to the list of _relations in the OperatingSystem
>> class variable
>>
>> Specify both sides of the relation (ToManyCont and ToOne)... lots
>> of examples of that all over the ZenModel/*.py files.
>>
>>
>> Code:
>> OperatingSystem._relations += ('physicalDisks',
>> ToManyCont(ToOne, ...))
>>
>>
>>
>> Then rebuild the relations on all the existing objects. You only
>> want to do this once since it means touching every device.
>>
>>
>> Code:
>> for d in dmd.getSubDevices():
>> d.os.buildRelations()
>>
>>
>>
>>
>> I hope this helps.
>>
>
>
>
>
>
> -------------------- m2f --------------------
>
> Read this topic online here:
> http://community.zenoss.com/forums/viewtopic.php?p=16918#16918
>
> -------------------- m2f --------------------
>
>
>
> _______________________________________________
> zenoss-dev mailing list
> zenoss-dev at zenoss.org
> http://lists.zenoss.org/mailman/listinfo/zenoss-dev
-EAD
Erik A. Dahl
Co-Founder and CTO, Zenoss Inc.
http://www.zenoss.com
More information about the zenoss-dev
mailing list