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

GetNetworkDomainByNameAction   A

Complexity

Total Complexity 2

Size/Duplication

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 2
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