| Total Complexity | 4 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more |
||
| 20 | class GetVMMoid(BaseAction): |
||
| 21 | |||
| 22 | def run(self, vm_names): |
||
| 23 | results = {} |
||
| 24 | |||
| 25 | vmlist = inventory.get_virtualmachines(self.si_content) |
||
| 26 | |||
| 27 | for vm in vmlist.view: |
||
| 28 | if vm_names: |
||
| 29 | if vm.name in vm_names: |
||
| 30 | results[vm.name] = str(vm).split(':')[-1].replace("'", "") |
||
| 31 | else: |
||
| 32 | results[vm.name] = str(vm).split(':')[-1].replace("'", "") |
||
| 33 | |||
| 34 | return results |
||
| 35 |