Completed
Pull Request — master (#407)
by Edward
02:14
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
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