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

ConsulQueryServiceAction.run()   A

Complexity

Conditions 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 4
rs 10
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