Skip to content

Bug is in api method deregister service. #119

@linuxoid69

Description

@linuxoid69
import consulate

consul_host = os.environ['CONSUL_HOST']

consul = consulate.Consul(consul_host)

consul.agent.service.deregister('redis')

Your code use Method GET. You need to use ### PUT.
So, service can't been deleted.

16:55:48.376090 IP colswic01.test.local.56820 > 172.18.0.2.8500: Flags [P.], seq 323:501, ack 491, win 245, options [nop,nop,TS val 1460761607 ecr 1460761605], length 178
E...L.@.@.............!4..:68.......Y......
W.t.W.t.GET /v1/agent/service/deregister/redis HTTP/1.1
Host: 127.0.0.1:8500
Accept-Encoding: gzip, deflate
Connection: keep-alive
User-Agent: python-requests/2.19.1
Accept: /

16:55:48.376423 IP 172.18.0.2.8500 > colswic01.test.local.56820: Flags [P.], seq 491:737, ack 501, win 252, options [nop,nop,TS val 1460761607 ecr 1460761607], length 246
E..*..@.@.H.........!4..8.....:.....YD.....
W.t.W.t.HTTP/1.1 405 Method Not Allowed
Allow: OPTIONS,PUT
Content-Encoding: gzip
Content-Type: text/plain; charset=utf-8
Vary: Accept-Encoding
Date: Mon, 25 Jun 2018 13:55:48 GMT
Content-Length: 46

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions