python-consul
python-consul copied to clipboard
AttributeError: 'Agent' object has no attribute 'token'
c = consul.Consul()
new_service = consul.Consul.Agent.Service(c.agent)
new_service.register(config['executor_id'])
Probably, I'm not using the Service correctly here, but still this code causes error in this line
this line
My bad, after reading the code I have realized that agent variable is not consul.Consul.Agent, but consul.Consul.
@gasabr python-consul2 The author may be a little busy, I will maintain a version, welcome to use. The new consul version was used. Progressively implement all API interfaces in the future
@gasabr you maby use like under
c = consul.Consul(port=acl_consul.port, token=acl_consul.token)
c.agent.service.register('service_name')