| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more |
||
| 19 | class NodeRemanage(OrionBaseAction): |
||
| 20 | def run(self, node): |
||
| 21 | """ |
||
| 22 | Remanage an Orion node |
||
| 23 | """ |
||
| 24 | |||
| 25 | self.connect() |
||
| 26 | |||
| 27 | orion_node = self.get_node(node) |
||
| 28 | |||
| 29 | if not orion_node.npm: |
||
| 30 | raise ValueError("Node not found") |
||
| 31 | |||
| 32 | NodeId = "N:{}".format(orion_node.npm_id) |
||
| 33 | |||
| 34 | orion_data = self.invoke("Orion.Nodes", "Remanage", NodeId) |
||
| 35 | |||
| 36 | # This Invoke always returns None, so check and return True |
||
| 37 | if orion_data is None: |
||
| 38 | return True |
||
| 39 | else: |
||
| 40 | return orion_data |
||
| 41 |