| @@ 360-370 (lines=11) @@ | ||
| 357 | else: |
|
| 358 | return [] |
|
| 359 | ||
| 360 | def update_when_from_rule(self, to_update): |
|
| 361 | additional_when = "" |
|
| 362 | if self.associated_rule.platform == "machine": |
|
| 363 | additional_when = ('ansible_virtualization_role != "guest" ' |
|
| 364 | 'or ansible_virtualization_type != "docker"') |
|
| 365 | to_update.setdefault("when", "") |
|
| 366 | new_when = ssg.yaml.update_yaml_list_or_string(to_update["when"], additional_when) |
|
| 367 | if not new_when: |
|
| 368 | to_update.pop("when") |
|
| 369 | else: |
|
| 370 | to_update["when"] = new_when |
|
| 371 | ||
| 372 | def update(self, parsed, config, product): |
|
| 373 | for p in parsed: |
|
| @@ 161-171 (lines=11) @@ | ||
| 158 | else: |
|
| 159 | return [] |
|
| 160 | ||
| 161 | def update_when_from_rule(self, to_update): |
|
| 162 | additional_when = "" |
|
| 163 | if self.rule.platform == "machine": |
|
| 164 | additional_when = ('ansible_virtualization_role != "guest" ' |
|
| 165 | 'or ansible_virtualization_type != "docker"') |
|
| 166 | to_update.setdefault("when", "") |
|
| 167 | new_when = update_yaml_list_or_string(to_update["when"], additional_when) |
|
| 168 | if not new_when: |
|
| 169 | to_update.pop("when") |
|
| 170 | else: |
|
| 171 | to_update["when"] = new_when |
|
| 172 | ||
| 173 | def update(self, platform): |
|
| 174 | for p in self.parsed: |
|