| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 92.86% |
| Changes | 0 | ||
| 1 | 1 | from dataclasses import dataclass |
|
| 2 | |||
| 3 | |||
| 4 | 1 | @dataclass |
|
| 5 | 1 | class Remediation: |
|
| 6 | 1 | remediation_id: str = "" |
|
| 7 | 1 | system: str = "" |
|
| 8 | 1 | complexity: str = "" |
|
| 9 | 1 | disruption: str = "" |
|
| 10 | 1 | strategy: str = "" |
|
| 11 | 1 | fix: str = "" |
|
| 12 | |||
| 13 | 1 | def as_dict(self): |
|
| 14 | return { |
||
| 15 | "remediation_id": self.remediation_id, |
||
| 16 | "system": self.system, |
||
| 17 | "complexity": self.complexity, |
||
| 18 | "disruption": self.disruption, |
||
| 19 | "strategy": self.strategy, |
||
| 20 | "fix": self.fix, |
||
| 21 | } |
||
| 22 | |||
| 23 | 1 | def get_type(self): |
|
| 24 | 1 | script_types = { |
|
| 25 | "urn:xccdf:fix:script:sh": "Shell script", |
||
| 26 | "urn:xccdf:fix:script:ansible": "Ansible snippet", |
||
| 27 | "urn:xccdf:fix:script:puppet": "Puppet snippet", |
||
| 28 | "urn:redhat:anaconda:pre": "Anaconda snippet", |
||
| 29 | "urn:xccdf:fix:script:kubernetes": "Kubernetes snippet", |
||
| 30 | "urn:redhat:osbuild:blueprint": "OSBuild Blueprint snippet", |
||
| 31 | } |
||
| 32 | return script_types.get(self.system, "script") |
||
| 33 |