| Total Complexity | 7 |
| Total Lines | 12 |
| Duplicated Lines | 0 % |
| 1 | from lib.base import QualysBaseAction |
||
| 8 | class AddHostAction(QualysBaseAction): |
||
| 9 | def run(self, host, vulnerability_management, policy_compliance): |
||
| 10 | if policy_compliance and vulnerability_management: |
||
| 11 | host_type = 'both' |
||
| 12 | elif policy_compliance and not vulnerability_management: |
||
| 13 | host_type = 'pc' |
||
| 14 | elif not policy_compliance and vulnerability_management: |
||
| 15 | host_type = 'vm' |
||
| 16 | else: |
||
| 17 | host_type = '' |
||
| 18 | host = self.connection.addHost(host, host_type) |
||
| 19 | return self.resultsets.formatter(host) |
||
| 20 |