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

ComputeNodeAction.run()   A

Complexity

Conditions 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 11
rs 9.4285
1
from lib import actions
2
3
__all__ = [
4
    'ComputeNodeAction',
5
]
6
7
8
class ComputeNodeAction(actions.BaseAction):
9
10
    def run(self, **kwargs):
11
        node_id = kwargs['node_id']
12
        del kwargs['node_id']
13
        action = kwargs['action']
14
        del kwargs['action']
15
        region = kwargs['region']
16
        del kwargs['region']
17
        driver = self._get_compute_driver(region)
18
        node = driver.ex_get_node_by_id(node_id)
19
        kwargs['node'] = node
20
        return self._do_function(driver, action, **kwargs)
21