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

        Roman Shaposhnik created issue -
        Roman Shaposhnik made changes -
        Field Original Value New Value
        Fix Version/s 0.4.0 [ 12318889 ]
        Fix Version/s 0.3.0 [ 12317841 ]
        Gavin made changes -
        Workflow no-reopen-closed, patch-avail [ 12643138 ] patch-available, re-open possible [ 12665983 ]
        Roman Shaposhnik made changes -
        Fix Version/s 0.5.0 [ 12321865 ]
        Fix Version/s 0.4.0 [ 12318889 ]
        Roman Shaposhnik made changes -
        Fix Version/s 0.6.0 [ 12323895 ]
        Fix Version/s 0.5.0 [ 12321865 ]
        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?
        Konstantin Boudnik made changes -
        Assignee Roman Shaposhnik [ rvs ] Konstantin Boudnik [ cos ]
        Konstantin Boudnik made changes -
        Assignee Konstantin Boudnik [ cos ] Roman Shaposhnik [ rvs ]
        Hide
        Konstantin Boudnik added a comment -

        Possible solution

        Show
        Konstantin Boudnik added a comment - Possible solution
        Konstantin Boudnik made changes -
        Attachment BIGTOP-275.patch [ 12574920 ]
        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
        Roman Shaposhnik made changes -
        Fix Version/s 0.6.0 [ 12323895 ]
        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.
        Konstantin Boudnik made changes -
        Attachment BIGTOP-275.patch [ 12575599 ]
        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.
        Konstantin Boudnik made changes -
        Attachment BIGTOP-275.patch [ 12575891 ]
        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
        Konstantin Boudnik made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Roman Shaposhnik [ rvs ] Konstantin Boudnik [ cos ]
        Fix Version/s 0.6.0 [ 12323895 ]
        Resolution Fixed [ 1 ]
        Roman Shaposhnik made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        491d 19h 52m 1 Konstantin Boudnik 28/Mar/13 22:24
        Resolved Resolved Closed Closed
        85d 1h 25m 1 Roman Shaposhnik 22/Jun/13 00:49

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development