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

never detects jenkins start #9

Closed
ahamid opened this issue Jul 6, 2012 · 1 comment
Closed

never detects jenkins start #9

ahamid opened this issue Jul 6, 2012 · 1 comment

Comments

@ahamid
Copy link

ahamid commented Jul 6, 2012

This code does not accept a 403 Forbidden as a successful response to the test to determine whether jenkins has started. My Jenkins instance requires authentication. The Chef run hangs indefinitely:

loop do
  url = URI.parse("#{node.jenkins.server.url}/job/test/config.xml")
  res = Chef::REST::RESTRequest.new(:GET, url, nil).call
  break if res.kind_of?(Net::HTTPSuccess) or res.kind_of?(Net::HTTPNotFound)
  Chef::Log.debug "service[jenkins] not responding OK to GET / #{res.inspect}"
  sleep 1
end

This change fixes it:

break if res.kind_of?(Net::HTTPSuccess) or res.kind_of?(Net::HTTPNotFound) or res.kind_of?(Net::HTTPForbidden)

@fujin fujin closed this as completed Feb 28, 2013
@patcon
Copy link
Contributor

patcon commented Mar 1, 2013

See #23 :)

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

3 participants