fetch jenkins username/password from .netrc
Bug #941400 reported by
Domen Kožar
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Python Jenkins |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
It would be really useful if python-jenkins would fetch http authentication details from .netrc
Changed in python-jenkins: | |
importance: | Undecided → Wishlist |
Changed in python-jenkins: | |
assignee: | Sorin Sbarnea (ssbarnea) → nobody |
status: | New → Fix Released |
To post a comment you must log in.
The python standard library comes with a netrc module ( https:/ /docs.python. org/3.5/ library/ netrc.html ) for a long while now . Using that to extract the credentials is as simple as:
import netrc authenticators( 'server. name')
...
...
netrc_cfg = netrc.netrc() # defaults to using ~/.netrc
username, _, password = netrc_cfg.
...which can then be use to construct the Jenkins instance from python-jenkins.
If however, the maintainer feels like this would be good to build into python-jenkins itself, I'm happy to submit a patch.