Bigtop
  1. Bigtop
  2. BIGTOP-275

scoping of variable in puppet code is incorrect

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.2.0
    • Fix Version/s: 0.6.0
    • Component/s: deployment
    • Labels:
      None

      Description

      It seems that the variable that are referenced in our templates are actually coming from cluster.pp scope and not individual modules. This is especially visible in hadoop module. Need to investigate.

      1. BIGTOP-275.patch
        4 kB
        Konstantin Boudnik
      2. BIGTOP-275.patch
        4 kB
        Konstantin Boudnik
      3. BIGTOP-275.patch
        4 kB
        Konstantin Boudnik

        Activity

        Hide
        Konstantin Boudnik added a comment -

        I am not sure if this is related but Puppet 3.1.1 refuses to compile template code like
        <value><%= zookeeper_quorum %></value>
        However, this
        <value><%= $zookeeper_quorum %></value>
        works. Is it another case of backward "compatibility" in the Puppet?

        Show
        Konstantin Boudnik added a comment - I am not sure if this is related but Puppet 3.1.1 refuses to compile template code like <value><%= zookeeper_quorum %></value> However, this <value><%= $zookeeper_quorum %></value> works. Is it another case of backward "compatibility" in the Puppet?
        Hide
        Konstantin Boudnik added a comment -

        Possible solution

        Show
        Konstantin Boudnik added a comment - Possible solution
        Hide
        Roman Shaposhnik added a comment -

        Cos, this is the first time I see $var use in templates. What does it mean exactly? My reading of Puppet docs (http://docs.puppetlabs.com/guides/templating.html#referencing-variables) reveals the following ways of reference a var inside of an erb template:

        1. Ruby instance variables — that is, @fqdn, @memoryfree, @operatingsystem, etc.
        2. Ruby local variables — that is, fqdn, memoryfree, operatingsystem, etc., without the prepended @ sign.

        Is there any reason we should be using $var ?

        Show
        Roman Shaposhnik added a comment - Cos, this is the first time I see $var use in templates. What does it mean exactly? My reading of Puppet docs ( http://docs.puppetlabs.com/guides/templating.html#referencing-variables ) reveals the following ways of reference a var inside of an erb template: Ruby instance variables — that is, @fqdn, @memoryfree, @operatingsystem, etc. Ruby local variables — that is, fqdn, memoryfree, operatingsystem, etc., without the prepended @ sign. Is there any reason we should be using $var ?
        Hide
        Konstantin Boudnik added a comment -

        Well, using local variables didn't work for whatever reason. I was getting the compilation errors. My patch might a total wacko, but at least Puppet 3.x eats it this way

        Show
        Konstantin Boudnik added a comment - Well, using local variables didn't work for whatever reason. I was getting the compilation errors. My patch might a total wacko, but at least Puppet 3.x eats it this way
        Hide
        Konstantin Boudnik added a comment -

        Using '@' instead of '$' as per earlier discussion. Seems to be working with Puppet 3.x as well.

        Show
        Konstantin Boudnik added a comment - Using '@' instead of '$' as per earlier discussion. Seems to be working with Puppet 3.x as well.
        Hide
        Roman Shaposhnik added a comment -

        Cos, isn't the 2 patches identical? Or am I missing something?

        Show
        Roman Shaposhnik added a comment - Cos, isn't the 2 patches identical? Or am I missing something?
        Hide
        Konstantin Boudnik added a comment -

        I am sorry, a slip of fingers.

        Show
        Konstantin Boudnik added a comment - I am sorry, a slip of fingers.
        Hide
        Roman Shaposhnik added a comment -

        +1 can you please commit it?

        Show
        Roman Shaposhnik added a comment - +1 can you please commit it?
        Hide
        Konstantin Boudnik added a comment -

        Committed to master as ef5db96

        Show
        Konstantin Boudnik added a comment - Committed to master as ef5db96

          People

          • Assignee:
            Konstantin Boudnik
            Reporter:
            Roman Shaposhnik
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development