pyjen.utils.user_params module¶
Interfaces for parsing user defined configuration parameters
- class pyjen.utils.user_params.JenkinsConfigParser(defaults=None, dict_type=<class 'collections.OrderedDict'>, allow_no_value=False)[source]¶
Bases: ConfigParser.ConfigParser
Interface to the PyJen user configuration file
Config File Format ================== [http://jenkins_server_url] username=MyUserName password=MyPassword [http://another_jenkins_url] username=other_username password=other_password #Anonymous access can be defined like this [http://some_jenkins_url] username= password=
- For more details on the general format of the config file see these links:
- https://wiki.python.org/moin/ConfigParserExamples https://docs.python.org/2/library/configparser.html
- get_credentials(jenkins_url)[source]¶
Gets the authentication credentials for a given Jenkins URL
Parameters: jenkins_url (str) – arbitrary URL to the Jenkins REST API to retrieve credentials for URL may point to any arbitrary artifact on the Jenkins REST API. The credentials will be matched based on the section headers in any of the associated config files Returns: username and password for the given URL. Will return None if no credentials found. Return type: tuple()