Completed
Pull Request — master (#407)
by Edward
02:14
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
class ConsulQueryServiceAction(action.ConsulBaseAction):
4
    def run(self, service, tag=None):
5
        index, service = self.consul.catalog.service(service, tag=tag)
6
        addresses = [node['Address'] for node in service]
7
        return ','.join(addresses)
8