devopshq / teamcity

dohq-teamcity is a Python package providing access to the JetBrains TeamCity server API.
https://devopshq.github.io/teamcity/
MIT License
33 stars 12 forks source link

Override configuration (fixed, but without docs) #18

Open BarAluf opened 5 years ago

BarAluf commented 5 years ago

Hi, i have an ssl error which i can solve by insert my own certificate to your API client, but i don't find a way to override your configuration file. Conf file field name = self.ssl_ca_cert = None thanks, Bar Aluf

allburov commented 5 years ago

@BarAluf yep, do not exist correct way pass some parameters to configuration right now, unfortunately. I fixed this in develop-branch.

Could you try this give me feedback? I will add docs and merge to master this If it's solve you problem

Install package from git

pip install git+https://github.com/devopshq/teamcity#develop
conf = Configuration()
conf.ssl_ca_cert = '/path/to/file.crt'
# OR quick hack for testing
# conf.verify_ssl = False
tc = dohq_teamcity.TeamCity("http://teamcity.example.com", (sys.argv[1], sys.argv[2]), configuration=conf)
print(tc.server.get_server_info())
allburov commented 5 years ago

Solution available in version 1.0.2 in pypi. But I forgot to write an example in the documentation. I will do as I find free time