--force-formatter is passed to a version of chef-client that does not support it.
Hey We are using chef 10.30 (in some nodes) which does not support the --force-formatter option Is it possible to add a check box in the advanced section to disable it?
bash -c "export LC_ALL=en_US.UTF-8 && ssh -o 'StrictHostKeyChecking no' -i /var/lib/jenkins/.ssh/id_rsa root@gw 'sudo chef-client --force-formatter -l info -j /tmp/deploy-to-gw-by-root-chef.json --color'"
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-cli-1.4.0/lib/mixlib/cli.rb:229:in `parse_options': invalid option: --force-formatter (OptionParser::InvalidOption)
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.30.2/lib/chef/application.rb:70:in `configure_chef'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.30.2/lib/chef/application.rb:57:in `reconfigure'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.30.2/lib/chef/application/client.rb:195:in `reconfigure'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.30.2/lib/chef/application.rb:63:in `run'
from /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.30.2/bin/chef-client:26:in `<top (required)>'
from /usr/bin/chef-client:23:in `load'
from /usr/bin/chef-client:23:in `<main>'
ERROR: (Java::Hudson::AbortException)
Hi. That is not big deal. But will require some time as I am abit occupied with other stuff. My suggestion is add something like "chef10 compatible" check box, which is disabled by default?
Good enough. I have searched the code, seems that I can fix it myself. I just don't know where to put that flag (where is the code that shows the Advanced section?)
- https://github.com/melezhik/chef-plugin/blob/master/views/chef_builder/config.erb - is a view for plugin configuration layout,
f.advanced do ... endchunk - also be careful with check box / boolean types in jenkins as they are buggy in some way, there was some internal issues related to de-serialization boolean types from job's xml after jenkins restart, , see I HOW I solved this in plugins source code .
Practically this means tow things, adding brand new check box `foo' implies:
- adding INT wrapper as
attr_accessor :foo_intinside models/chef-builder.rb - reading check box foo value as
instance.get('foo_int')inside views/chef_builder/config.erb
See plugins code for details. I'd appreciate it if you make MR for this. Thanks