[LinuxFailSafe] Is there a better way to extract dependency info from resources?
Lars Marowsky-Bree
lmb@suse.de
Fri, 21 Jun 2002 11:31:27 +0200
On 2002-06-20T17:54:10,
Kashif Shaikh <kshaikh@consensys.com> said:
> I'm trying to write some custom plug-in scripts for custom resources
> types I have created. For many of the resource scripts, I need to
> extract dependency information(i.e. list of resources I depend on like
> IP_address).
>
> Yes, I could put the dependent info into the resource I'm creating, and
> make my task easier(I would just need to use s2_get_resource_attribute),
> but that means I gotta add more options to my custom resource, which I
> don't want to do.
I see that this is documented badly in README.scriptlib2.
You can use the following:
deps=$(s2_get_attributes $resource_type $resource_name all)
dep_IP=$(s2_get_attribute_value IP_address $deps)
To retrieve the dependency on an IP_address; this needs cleaning up slightly
as it also means that the resourceQuery gets called twice; it should do the
call once and save both kinds of information returned.
Sincerely,
Lars Marowsky-Brée <lmb@suse.de>
--
Immortality is an adequate definition of high availability for me.
--- Gregory F. Pfister