[ClusterLabs] ocf scripts shell and local variables
Kristoffer Grönlund
kgronlund at suse.com
Tue Aug 30 07:32:54 UTC 2016
Jehan-Guillaume de Rorthais <jgdr at dalibo.com> writes:
> On Mon, 29 Aug 2016 10:02:28 -0500
> Ken Gaillot <kgaillot at redhat.com> wrote:
>
>> On 08/29/2016 09:43 AM, Dejan Muhamedagic wrote:
> ...
>>> I doubt that we could do a moderately complex shell scripts
>>> without capability of limiting the variables' scope and retaining
>>> sanity at the same time.
>>
>> This prefixing approach would definitely be ugly, and it would violate
>> best practices on shells that do support local, but it should be feasible.
>>
>> I'd argue that anything moderately complex should be converted to python
>> (maybe after we have OCF 2.0, and some good python bindings ...).
>
> For what it worth, I already raised this discussion some month ago as we wrote
> some perl modules equivalent to ocf-shellfuncs, ocf-returncodes and
> ocf-directories. See:
>
> Subject: [ClusterLabs Developers] Perl Modules for resource agents (was:
> Resource Agent language discussion)
> Date: Thu, 26 Nov 2015 01:13:36 +0100
>
> I don't want to start a flameware about languages here, this is not about that.
> Maybe it would be a good time to include various libraries for different
> languages in official source? At least for ocf-directories which is quite
> simple, but often tied to the configure options in various distro. We had to
> make a ugly wrapper around the ocf-directories librairie on build time to
> produce our OCF_Directories.pm module on various distros.
>
I don't know Perl so I can't be very helpful reviewing it, but please do
submit your Perl OCF library to resource-agents if you have one! I don't
think anyone is opposed to including a Perl (or Python) API on
principle, it's just a matter of someone actually sitting down to do the
work putting it together.
Cheers,
Kristoffer
--
// Kristoffer Grönlund
// kgronlund at suse.com
More information about the Users
mailing list