Completed
Push — master ( 48b27b...9784f9 )
by Tomaz
22s
created

DrainNodeAction.run()   A

Complexity

Conditions 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 7
rs 9.4285
1
import requests
2
3
from lib.base import OpscenterAction
4
5
6
class DrainNodeAction(OpscenterAction):
7
    def run(self, node_ip, cluster_id=None):
8
        if not cluster_id:
9
            cluster_id = self.cluster_id
10
11
        url = self._get_full_url([cluster_id, 'ops', 'drain', node_ip])
12
13
        return requests.get(url).json()
14