dubbo-python2 icon indicating copy to clipboard operation
dubbo-python2 copied to clipboard

fix: ZkRegister object has no attribute 'hosts'

Open wuwen5 opened this issue 5 years ago • 2 comments

File "/Library/Python/2.7/site-packages/dubbo/client.py", line 157, in __resubscribe
    for interface in self.hosts.keys():
AttributeError: 'ZkRegister' object has no attribute 'hosts'

wuwen5 avatar Dec 16 '20 11:12 wuwen5

Thanks for the pr. Would you please provide the steps to reproduce this issue?

biyuhao avatar Dec 18 '20 03:12 biyuhao

just a normal call

from dubbo.client import DubboClient, ZkRegister

zk = ZkRegister('172.19.97.81:2181')

dubbo_cli = DubboClient('com.x.x.service.XProvider', zk_register=zk, version="2.0")

response = dubbo_cli.call('methodA', '13800138000')
Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/Library/Python/2.7/site-packages/dubbo/client.py", line 157, in __resubscribe
    for interface in self.hosts.keys():
AttributeError: 'ZkRegister' object has no attribute 'hosts'

wuwen5 avatar Dec 18 '20 08:12 wuwen5