pycontribs / jenkinsapi

A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
http://pypi.python.org/pypi/jenkinsapi
MIT License
858 stars 485 forks source link

domain is lost when querying a remote jenkins server #90

Closed pmolodo closed 11 years ago

pmolodo commented 11 years ago

Our company has a jenkins server, that is accessible from within our internal network as:

http://jenkins:8080

And remotely, as

http://jenkins.domain.name:8080

However, when I am at a remote location, and do:

Jenkins('http://jenkins.domain.name:8080').get_job('my_job')

the url that it ends up trying to access is:

http://jenkins:8080/job/my_job/

ie, it has lost the domain name.

This seems to be a fairly serious issue - it has certainly made jenkinsapi unusable for us...

lechat commented 11 years ago

Hi,

Jenkins.get_job() function uses configuration it obtained from Jenkins server. I think that in your Jenkins setup it is configured to use short domain - so that domain will be used, not the one you passed to Jenkins constructor.

Hope this helps.

salimfadhley commented 11 years ago

elrond79, I think this problem would be easily fixed with a minor LAN configuration.

I'd be happy to advise but it's probably outside the scope of this bug report. By the way, Jenkins is not a 'frontier' system - i.e. it's something you use within the safety of your office and not something you'd normally want to expose to the public, I'd advise people never to do what you appear to be doing. Jenkins should always be accessed via SSH tunnelling or VPN.

salimfadhley commented 11 years ago

@elrond79 I'm going to close this for now - feel free to contact me again if you are uncomfortable with all the LAN stuff.

pmolodo commented 11 years ago

Ok... I'll talk with my systems guys and see if they have any ideas on LAN configuration - otherwise, I probably will hit you up again. Thanks for the offer!

FYI - Jenkins is not broadly accessible, but only through our VPN. (We just have a setup where "jenkins" resolves to whatever the local jenkins server is, so that in our code we can simply use that whenever we want the local server... and then we use the full domain name if we need a specific or remote server.)

On Mon, Jun 3, 2013 at 7:05 AM, Salim Fadhley notifications@github.comwrote:

@elrond79 https://github.com/elrond79 I'm going to close this for now - feel free to contact me again if you are uncomfortable with all the LAN stuff.

— Reply to this email directly or view it on GitHubhttps://github.com/salimfadhley/jenkinsapi/issues/90#issuecomment-18843273 .

salimfadhley commented 11 years ago

Okay, so the obvious solution is to always use the full domain name and just have your net-ops people/person ensure that works.

On Mon, Jun 3, 2013 at 5:15 PM, Paul Molodowitch notifications@github.comwrote:

Ok... I'll talk with my systems guys and see if they have any ideas on LAN configuration - otherwise, I probably will hit you up again. Thanks for the offer!

FYI - Jenkins is not broadly accessible, but only through our VPN. (We just have a setup where "jenkins" resolves to whatever the local jenkins server is, so that in our code we can simply use that whenever we want the local server... and then we use the full domain name if we need a specific or remote server.)

On Mon, Jun 3, 2013 at 7:05 AM, Salim Fadhley notifications@github.comwrote:

@elrond79 https://github.com/elrond79 I'm going to close this for now

feel free to contact me again if you are uncomfortable with all the LAN stuff.

— Reply to this email directly or view it on GitHub< https://github.com/salimfadhley/jenkinsapi/issues/90#issuecomment-18843273>

.

— Reply to this email directly or view it on GitHubhttps://github.com/salimfadhley/jenkinsapi/issues/90#issuecomment-18852382 .