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

dot-separated attribute name #342

Open
scottsuch opened this issue Mar 28, 2016 · 1 comment
Open

dot-separated attribute name #342

scottsuch opened this issue Mar 28, 2016 · 1 comment
Labels

Comments

@scottsuch
Copy link

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"
    }
  }
}
@lamont-granquist
Copy link
Contributor

I believe this is tightly coupled to how varia_model was designed.

This is a legit bug. The fix, however, would require some major overhauling.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants