Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Apr 15, 2024. It is now read-only.

Conversation

@bobh66
Copy link

@bobh66 bobh66 commented Oct 17, 2017

Service deregister needs to be PUT instead of GET.

Also added tests for the Service object, using the API definition as comparisons.

@ahelal
Copy link

ahelal commented Oct 25, 2017

👍

@bobh66
Copy link
Author

bobh66 commented Oct 25, 2017

Workaround is:

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.

alvaroaleman added a commit to alvaroaleman/ansible that referenced this pull request Jan 14, 2018
Upstream pr in the python-consul library:
python-consul/python-consul#174

This is based on work from https://github.com/bobh

Fixes ansible#34628
ansibot pushed a commit to ansible/ansible that referenced this pull request Mar 6, 2018
* Fix consul module service deregistration

Upstream pr in the python-consul library:
python-consul/python-consul#174

This is based on work from https://github.com/bobh

Fixes #34628

* Pass ACL token when deregistering consul service
gundalow pushed a commit to gundalow/ansible that referenced this pull request Mar 6, 2018
* Fix consul module service deregistration

Upstream pr in the python-consul library:
python-consul/python-consul#174

This is based on work from https://github.com/bobh

Fixes ansible#34628

* Pass ACL token when deregistering consul service

(cherry picked from commit c9cb001)
gundalow added a commit to ansible/ansible that referenced this pull request Mar 6, 2018
* Fix consul module service deregistration

Upstream pr in the python-consul library:
python-consul/python-consul#174

This is based on work from https://github.com/bobh

Fixes #34628

* Pass ACL token when deregistering consul service

(cherry picked from commit c9cb001)
abadger pushed a commit to ansible/ansible that referenced this pull request Mar 29, 2018
* Fix consul module service deregistration

Upstream pr in the python-consul library:
python-consul/python-consul#174

This is based on work from https://github.com/bobh

Fixes #34628

* Pass ACL token when deregistering consul service

(cherry picked from commit c9cb001)
@cablehead
Copy link
Collaborator

#182 is finally merged. Please re-open if this is still an issue. Thanks @matusvalo!

@cablehead cablehead closed this May 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.