[ClusterLabs] ocf scripts shell and local variables

Jehan-Guillaume de Rorthais jgdr at dalibo.com
Mon Aug 29 16:04:40 UTC 2016


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.

Regards,




More information about the Users mailing list