Completed
Pull Request — master (#415)
by Anthony
02:10
created

GetNetworkDomainByNameAction.run()   A

Complexity

Conditions 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 6
rs 9.4285
1
from lib import actions
2
3
__all__ = [
4
    'GetNetworkDomainByNameAction',
5
]
6
7
8
class GetNetworkDomainByNameAction(actions.BaseAction):
9
10
    def run(self, region, network_domain_name):
11
        driver = self._get_compute_driver(region)
12
        networkdomains = driver.ex_list_network_domains()
13
        networkdomain = list(filter(lambda x: x.name == network_domain_name,
14
                            networkdomains))[0]
15
        return self.resultsets.formatter(networkdomain)
16