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

[feature_parameters] jenkins object connection parameters #828

Open
JayChanggithub opened this issue Nov 24, 2022 · 2 comments
Open

[feature_parameters] jenkins object connection parameters #828

JayChanggithub opened this issue Nov 24, 2022 · 2 comments

Comments

@JayChanggithub
Copy link

JayChanggithub commented Nov 24, 2022

Hi Support,

i wanna to adopt proxies parameter when i create Jenkins object. Because of our jenkins instance need through proxies to connect. Have anything possible to do these like below sample code ? i saw the source code cannot input additional parameters like proxies. If so how to do? Thanks

from jenkinsapi.jenkins import Jenkins
proxies = {
   'http': 'http://tunnel-http-proxy.pipeline-tunnel:8080'
}


jenkinsClient = Jenkins(
    url,
    username=username,
    password=password,
    ssl_verify=False,
    max_retries=30,
    timeout=120,
    proxies=proxies
)
@vetsin
Copy link

vetsin commented Mar 1, 2023

Since i looked here first, i'll post how I worked around this:

import jenkinsapi, urllib

server = jenkinsapi.jenkins.Jenkins(server_uri, username=username, password=password)
server.requester.session.proxies = urllib.request.getproxies()

@pbelskiy
Copy link

pbelskiy commented Feb 2, 2024

Any updates?

@vetsin
Yes it should work, but you patch private variable, so it could not work in future.

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