Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--force-formatter is passed to a version of chef-client that does not support it. #9

Open
aharonha opened this issue Dec 3, 2015 · 3 comments
Assignees

Comments

@aharonha
Copy link

aharonha commented Dec 3, 2015

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)


@melezhik melezhik self-assigned this Dec 3, 2015
@melezhik
Copy link
Owner

melezhik commented Dec 3, 2015

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?

@aharonha
Copy link
Author

aharonha commented Dec 3, 2015

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?)

@melezhik
Copy link
Owner

melezhik commented Dec 3, 2015

  • https://github.com/melezhik/chef-plugin/blob/master/views/chef_builder/config.erb - is a view for plugin configuration layout, f.advanced do ... end chunk
  • 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_int inside 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

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

No branches or pull requests

2 participants