You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 15, 2024. It is now read-only.
Is this code really like this? when change 'get' to 'put' ,it works...
defderegister(self, service_id):
""" Used to remove a service from the local agent. The agent will take care of deregistering the service with the Catalog. If there is an associated check, that is also deregistered. """# return self.agent.http.get(# CB.bool(), '/v1/agent/service/deregister/%s' % service_id)returnself.agent.http.put(
CB.bool(), '/v1/agent/service/deregister/%s'%service_id)
I don't know when the above PR will be accepted, so if you need a workaround you can do something like this:
from consul import Consul
from consul.base import CB
class MyAgentService(Consul.Agent.Service):
def deregister(self, service_id):
return self.agent.http.put(CB.bool(), '/v1/agent/service/deregister/%s' % service_id)
client = Consul(host=host, port=port)
client.agent.service = MyAgentService(consul)
This will override the "bad" deregister method and use put instead of get.
Activity
bobh66 commentedon Oct 25, 2017
See PR #174
bobh66 commentedon Oct 25, 2017
I don't know when the above PR will be accepted, so if you need a workaround you can do something like this:
This will override the "bad" deregister method and use put instead of get.
chinakevinguo commentedon Oct 26, 2017
ok, thanks ,i'll close this issue