FAQ
I've come across this expression in erb files, for example here:

https://github.com/cloudfoundry/cf-release/blob/master/jobs/postgres/templates/pg_hba.conf.erb

What does "properties.send(...)" do? How is it evaluated? I searched in
documentation and also here in forums but did not find anything. May be I'm
just missing something obvious, but could anyone briefly explain, please?

Search Discussions

  • Oleg Shaldybin at Jul 4, 2012 at 5:16 pm
    Hi Igor,

    "properties" is a Ruby OpenStruct object, it's a part of instance spec
    which is available to all BOSH job templates. "send" is a Ruby method that
    allows you to invoke methods on the object (foo.send(:bar) is the same as
    foo.bar).

    You can see the binding in which these templates are being evaluated here:

    https://github.com/cloudfoundry/bosh/blob/master/director/lib/director/configuration_hasher.rb#L6
    On Wed, Jul 4, 2012 at 9:14 AM, Igor Mihalik wrote:

    I've come across this expression in erb files, for example here:


    https://github.com/cloudfoundry/cf-release/blob/master/jobs/postgres/templates/pg_hba.conf.erb

    What does "properties.send(...)" do? How is it evaluated? I searched in
    documentation and also here in forums but did not find anything. May be I'm
    just missing something obvious, but could anyone briefly explain, please?


    --
    Best,
    Oleg
  • Igor Mihalik at Jul 5, 2012 at 9:15 am
    thanks Oleg, so effectively what this does is that the "db" variable (which
    is result of assignment) references object given by value of
    "properties.db"? (in this specific postgres template), like in this example
    "db.roles" will contain two elements:

    properties:
    db: ccdb
    ccdb:
    roles:
    - name: role1
    - name: role2

    The main reason I'm asking about this is that cloud_controller now has two
    options for ccdb, it can either be ccdb_postgres or postgres teamplate and
    using postgres template seems to reduce some duplicities in manifest. The
    sample here seems invalid for both options:
    https://github.com/cloudfoundry/oss-docs/blob/master/bosh/samples/cloudfoundry.yml
    So now I'm trying to figure out how to do it properly.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbosh-users @
postedJul 4, '12 at 4:14p
activeJul 5, '12 at 9:15a
posts3
users2

2 users in discussion

Igor Mihalik: 2 posts Oleg Shaldybin: 1 post

People

Translate

site design / logo © 2022 Grokbase