Completed
Pull Request — master (#406)
by Edward
02:04
created

BaseAction.do_action()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 3
rs 10
1
import digitalocean
2
from st2actions.runners.pythonrunner import Action
3
4
5
class BaseAction(Action):
6
7
    def __init__(self, config):
8
        super(BaseAction, self).__init__(config)
9
        self._token = config['token']
10
11
    def do_action(self,cls,action,**kwargs):
0 ignored issues
show
Coding Style introduced by
Exactly one space required after comma
def do_action(self,cls,action,**kwargs):
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
def do_action(self,cls,action,**kwargs):
^
Loading history...
Coding Style introduced by
Exactly one space required after comma
def do_action(self,cls,action,**kwargs):
^
Loading history...
12
      obj = getattr(digitalocean,cls)(token=self._token)
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 6 were found.
Loading history...
Coding Style introduced by
Exactly one space required after comma
obj = getattr(digitalocean,cls)(token=self._token)
^
Loading history...
13
      return getattr(obj,action)(**kwargs)
0 ignored issues
show
Coding Style introduced by
The indentation here looks off. 8 spaces were expected, but 6 were found.
Loading history...
Coding Style introduced by
Exactly one space required after comma
return getattr(obj,action)(**kwargs)
^
Loading history...
14