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
...
...
netrc_cfg = netrc.netrc()    # defaults to using ~/.netrc
username, _, password = netrc_cfg.authenticators('server.name')

...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.

-- 
You received this bug notification because you are a member of Python
Jenkins Developers, which is subscribed to Python Jenkins.
https://bugs.launchpad.net/bugs/941400

Title:
  fetch jenkins username/password from .netrc

Status in Python Jenkins:
  New

Bug description:
  It would be really useful if python-jenkins would fetch http
  authentication details from .netrc

To manage notifications about this bug go to:
https://bugs.launchpad.net/python-jenkins/+bug/941400/+subscriptions

-- 
Mailing list: https://launchpad.net/~python-jenkins-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~python-jenkins-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to