Skip to content
This repository was archived by the owner on Mar 21, 2018. It is now read-only.
This repository was archived by the owner on Mar 21, 2018. It is now read-only.

dot-separated attribute name #342

@scottsuch

Description

@scottsuch

I've inherited some dot-separated node attributes that I'm attempting to alter via ridley.

The items look like:

"installer": {
  "properties": {
    "config.admin.email": "admin@scottsuch.test.com"
  }
}

Is there any way to escape the dots and tell ridely to update ['installer']['properties']['config.admin.email']

Some sample code:

require 'ridley'

kniferb = 'kniferb'
private_host = 'hostname'
new_url = 'scottsuch2.test.com'

ridley = Ridley.from_chef_config(kniferb, ssl: { verify: false })
node = ridley.node.find(private_host)

attr = 'installer.properties["config.admin.email"]'
node.set_chef_attribute(attr, "admin@#{new_url}")

After running the above, knife node edit gives me:

"installer": {
  "properties[\"config": {
    "admin": {
      "email\"]": "admin@scottsuch2.test.com"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions