1

When I try to update an environment attribute in chef using knife like this to pick up the definition from a json file using "from file" it reports "Object unchanged, not saving" even though I have changed an attribute value in my json file:

knife environment  --disable-editing edit <environment name> from file environment.json 

If I remove the --disable-editing option it then invokes the text editor which is not what I want as I need to programatically update the attribute from a script

Any idea what I am missing?

This is Chef: 11.10.4

user3488588
  • 21
  • 1
  • 3

1 Answers1

4

You want to upload the environment:

knife environment from file <path>
sethvargo
  • 26,739
  • 10
  • 86
  • 156
  • Thanks - that worked (I did have to force the encoding when writing out the json file in the first place to overcome an error "Yajl::ParseError: lexical error: invalid char in json text.") – user3488588 Apr 03 '14 at 16:29