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

DeleteNetworkAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %
Metric Value
dl 0
loc 21
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 19 1
1
from lib import actions
2
from libcloud.compute.drivers.dimensiondata import DimensionDataNetwork
3
4
__all__ = [
5
    'DeleteNetworkAction',
6
]
7
8
9
class DeleteNetworkAction(actions.BaseAction):
10
11
    def run(self, **kwargs):
12
        action = kwargs['action']
13
        del kwargs['action']
14
        region = kwargs['region']
15
        del kwargs['region']
16
        network_id = kwargs['network_id']
17
        del kwargs['network_id']
18
        driver = self._get_compute_driver(region)
19
        network = DimensionDataNetwork(
20
            id=network_id,
21
            name=None,
22
            description=None,
23
            location=None,
24
            private_net=None,
25
            multicast=None,
26
            status=None
27
        )
28
        kwargs['network'] = network
29
        return self._do_function(driver, action, **kwargs)
30