blob: 01e3dd6875108a32c2844f681e246decb7b07ca2 [file] [log] [blame]
Andrew Geisslerf31b8bd2020-11-30 19:54:56 -06001From e435bf2dc59d652710104a1c59332e410b12bb64 Mon Sep 17 00:00:00 2001
2From: Vojtech Polasek <vpolasek@redhat.com>
3Date: Mon, 8 Jun 2020 12:33:48 +0200
4Subject: [PATCH] fix deprecated instance of element.getchildren
5
6Upstream-Status: Backport
7[https://github.com/ComplianceAsCode/content/commit/e435bf2dc59d652710104a1c59332e410b12bb64]
8
9Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
10---
11 ssg/build_remediations.py | 2 +-
12 ssg/build_stig.py | 2 +-
13 2 files changed, 2 insertions(+), 2 deletions(-)
14
15diff --git a/ssg/build_remediations.py b/ssg/build_remediations.py
16index fdde0f268..c18d6bd54 100644
17--- a/ssg/build_remediations.py
18+++ b/ssg/build_remediations.py
19@@ -735,7 +735,7 @@ def expand_xccdf_subs(fix, remediation_type, remediation_functions):
20 # First concat output form of modified fix text (including text appended
21 # to all children of the fix)
22 modfix = [fix.text]
23- for child in fix.getchildren():
24+ for child in list(fix):
25 if child is not None and child.text is not None:
26 modfix.append(child.text)
27 modfixtext = "".join(modfix)
28diff --git a/ssg/build_stig.py b/ssg/build_stig.py
29index 528285f3d..6122981fc 100644
30--- a/ssg/build_stig.py
31+++ b/ssg/build_stig.py
32@@ -38,7 +38,7 @@ def add_references(reference, destination):
33 for ref in refs:
34 if (ref.get('href').startswith(stig_refs) and
35 ref.text in dictionary):
36- index = rule.getchildren().index(ref)
37+ index = list(rule).index(ref)
38 new_ref = ET.Element(
39 '{%s}reference' % XCCDF11_NS, {'href': stig_ns})
40 new_ref.text = dictionary[ref.text]
41--
422.17.1
43