Completed
Push — master ( 591bf0...c4b659 )
by Edward
01:58
created

ConsulQueryServiceAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 5
Duplicated Lines 0 %
Metric Value
dl 0
loc 5
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 4 2
1
from lib import action
2
3
4
class ConsulQueryServiceAction(action.ConsulBaseAction):
5
    def run(self, service, tag=None):
6
        index, service = self.consul.catalog.service(service, tag=tag)
7
        addresses = [node['Address'] for node in service]
8
        return ','.join(addresses)
9