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

GetNetworkByNameAction   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
    'GetNetworkByNameAction',
5
]
6
7
8
class GetNetworkByNameAction(actions.BaseAction):
9
10
    def run(self, region, network_name):
11
        driver = self._get_compute_driver(region)
12
        networks = driver.ex_list_networks()
13
        network = list(filter(lambda x: x.name == network_name,
14
                              networks))[0]
15
        return self.resultsets.formatter(network)
16