keijack / python-eureka-client

A eureka client written in python. Support registering your python component to Eureka Server, as well as calling remote services by pulling the the Eureka registry.
MIT License
183 stars 43 forks source link

Exception in discovery only mode #40

Closed peter254 closed 3 years ago

peter254 commented 3 years ago

When using the init method in discovery-mode only, then there is an exception. Code to execute: eureka_client.init(eureka_server='https://...', should_register=False, instance_host='something')

Exception: Attribute Error: 'EurekaClient' object has no attribute '_EurekaClient__instance_host'

I think I have found the reason: In file eureka_client.py, line 959 the attribute instance_host is accessed, but when should_register=False then the attribute is never set.

If instance_host is not set, then it fails one line earlier with the same message.

keijack commented 3 years ago

Thanks for submitting. This is a bug, and has been fixed, please upgrade to v0.8.7.

keijack commented 3 years ago

@peter254 I'm closing this, if you have any problem, start a new issue.

peter254 commented 3 years ago

Thank you for the quick fix!! Awesome!