1 From e2c3983c04bb91d0a1367e1f16ebf081e3a00658 Mon Sep 17 00:00:00 2001
2 From: Tero Saarni <tero.saarni@est.tech>
3 Date: Wed, 21 Apr 2021 16:40:43 +0300
4 Subject: [PATCH] Version bump to pyyaml 5.4.1 (#1596)
7 curator/utils.py | 2 +-
8 test/unit/test_class_index_list.py | 20 ++++++++++----------
9 test/unit/test_class_snapshot_list.py | 8 ++++----
10 3 files changed, 15 insertions(+), 15 deletions(-)
12 diff --git a/curator/utils.py b/curator/utils.py
13 index 3af2c78..0309a4f 100644
14 --- a/curator/utils.py
15 +++ b/curator/utils.py
16 @@ -56,7 +56,7 @@ def get_yaml(path):
17 yaml.add_constructor('!single', single_constructor)
20 - return yaml.load(read_file(path))
21 + return yaml.load(read_file(path), Loader=yaml.FullLoader)
22 except yaml.scanner.ScannerError as err:
23 print('Unable to read/parse YAML file: {0}'.format(path))
25 diff --git a/test/unit/test_class_index_list.py b/test/unit/test_class_index_list.py
26 index 1cf20f4..cfc4621 100644
27 --- a/test/unit/test_class_index_list.py
28 +++ b/test/unit/test_class_index_list.py
29 @@ -800,7 +800,7 @@ class TestIterateFiltersIndex(TestCase):
30 client.cluster.state.return_value = testvars.clu_state_four
31 client.indices.stats.return_value = testvars.stats_four
32 ilo = curator.IndexList(client)
33 - config = yaml.load(testvars.pattern_ft)['actions'][1]
34 + config = yaml.load(testvars.pattern_ft, Loader=yaml.FullLoader)['actions'][1]
35 ilo.iterate_filters(config)
36 self.assertEqual(['a-2016.03.03'], ilo.indices)
37 def test_age_filtertype(self):
38 @@ -810,7 +810,7 @@ class TestIterateFiltersIndex(TestCase):
39 client.cluster.state.return_value = testvars.clu_state_two
40 client.indices.stats.return_value = testvars.stats_two
41 ilo = curator.IndexList(client)
42 - config = yaml.load(testvars.age_ft)['actions'][1]
43 + config = yaml.load(testvars.age_ft, Loader=yaml.FullLoader)['actions'][1]
44 ilo.iterate_filters(config)
45 self.assertEqual(['index-2016.03.03'], ilo.indices)
46 def test_space_filtertype(self):
47 @@ -821,7 +821,7 @@ class TestIterateFiltersIndex(TestCase):
48 client.indices.stats.return_value = testvars.stats_four
49 client.field_stats.return_value = testvars.fieldstats_four
50 ilo = curator.IndexList(client)
51 - config = yaml.load(testvars.space_ft)['actions'][1]
52 + config = yaml.load(testvars.space_ft, Loader=yaml.FullLoader)['actions'][1]
53 ilo.iterate_filters(config)
54 self.assertEqual(['a-2016.03.03'], ilo.indices)
55 def test_forcemerge_filtertype(self):
56 @@ -832,7 +832,7 @@ class TestIterateFiltersIndex(TestCase):
57 client.indices.stats.return_value = testvars.stats_one
58 client.indices.segments.return_value = testvars.shards
59 ilo = curator.IndexList(client)
60 - config = yaml.load(testvars.forcemerge_ft)['actions'][1]
61 + config = yaml.load(testvars.forcemerge_ft, Loader=yaml.FullLoader)['actions'][1]
62 ilo.iterate_filters(config)
63 self.assertEqual([testvars.named_index], ilo.indices)
64 def test_allocated_filtertype(self):
65 @@ -842,7 +842,7 @@ class TestIterateFiltersIndex(TestCase):
66 client.cluster.state.return_value = testvars.clu_state_two
67 client.indices.stats.return_value = testvars.stats_two
68 ilo = curator.IndexList(client)
69 - config = yaml.load(testvars.allocated_ft)['actions'][1]
70 + config = yaml.load(testvars.allocated_ft, Loader=yaml.FullLoader)['actions'][1]
71 ilo.iterate_filters(config)
72 self.assertEqual(['index-2016.03.04'], ilo.indices)
73 def test_kibana_filtertype(self):
74 @@ -857,7 +857,7 @@ class TestIterateFiltersIndex(TestCase):
76 '.kibana', '.kibana-5', '.kibana-6', 'dummy'
78 - config = yaml.load(testvars.kibana_ft)['actions'][1]
79 + config = yaml.load(testvars.kibana_ft, Loader=yaml.FullLoader)['actions'][1]
80 ilo.iterate_filters(config)
81 self.assertEqual(['dummy'], ilo.indices)
82 def test_opened_filtertype(self):
83 @@ -868,7 +868,7 @@ class TestIterateFiltersIndex(TestCase):
84 client.indices.stats.return_value = testvars.stats_four
85 client.field_stats.return_value = testvars.fieldstats_four
86 ilo = curator.IndexList(client)
87 - config = yaml.load(testvars.opened_ft)['actions'][1]
88 + config = yaml.load(testvars.opened_ft, Loader=yaml.FullLoader)['actions'][1]
89 ilo.iterate_filters(config)
90 self.assertEqual(['c-2016.03.05'], ilo.indices)
91 def test_closed_filtertype(self):
92 @@ -879,7 +879,7 @@ class TestIterateFiltersIndex(TestCase):
93 client.indices.stats.return_value = testvars.stats_four
94 client.field_stats.return_value = testvars.fieldstats_four
95 ilo = curator.IndexList(client)
96 - config = yaml.load(testvars.closed_ft)['actions'][1]
97 + config = yaml.load(testvars.closed_ft, Loader=yaml.FullLoader)['actions'][1]
98 ilo.iterate_filters(config)
100 ['a-2016.03.03','b-2016.03.04','d-2016.03.06'], sorted(ilo.indices))
101 @@ -890,7 +890,7 @@ class TestIterateFiltersIndex(TestCase):
102 client.cluster.state.return_value = testvars.clu_state_two
103 client.indices.stats.return_value = testvars.stats_two
104 ilo = curator.IndexList(client)
105 - config = yaml.load(testvars.none_ft)['actions'][1]
106 + config = yaml.load(testvars.none_ft, Loader=yaml.FullLoader)['actions'][1]
107 ilo.iterate_filters(config)
109 ['index-2016.03.03', 'index-2016.03.04'], sorted(ilo.indices))
110 @@ -901,7 +901,7 @@ class TestIterateFiltersIndex(TestCase):
111 client.cluster.state.return_value = testvars.clu_state_two
112 client.indices.stats.return_value = testvars.stats_two
113 ilo = curator.IndexList(client)
114 - config = yaml.load(testvars.invalid_ft)['actions'][1]
115 + config = yaml.load(testvars.invalid_ft, Loader=yaml.FullLoader)['actions'][1]
117 curator.ConfigurationError,
118 ilo.iterate_filters, config
119 diff --git a/test/unit/test_class_snapshot_list.py b/test/unit/test_class_snapshot_list.py
120 index d419faf..d77bccd 100644
121 --- a/test/unit/test_class_snapshot_list.py
122 +++ b/test/unit/test_class_snapshot_list.py
123 @@ -320,7 +320,7 @@ class TestIterateFiltersSnaps(TestCase):
124 client.snapshot.get.return_value = testvars.snapshots
125 client.snapshot.get_repository.return_value = testvars.test_repo
126 slo = curator.SnapshotList(client, repository=testvars.repo_name)
127 - config = yaml.load(testvars.invalid_ft)['actions'][1]
128 + config = yaml.load(testvars.invalid_ft, Loader=yaml.FullLoader)['actions'][1]
130 curator.ConfigurationError,
131 slo.iterate_filters, config
132 @@ -330,7 +330,7 @@ class TestIterateFiltersSnaps(TestCase):
133 client.snapshot.get.return_value = testvars.snapshots
134 client.snapshot.get_repository.return_value = testvars.test_repo
135 slo = curator.SnapshotList(client, repository=testvars.repo_name)
136 - config = yaml.load(testvars.snap_age_ft)['actions'][1]
137 + config = yaml.load(testvars.snap_age_ft, Loader=yaml.FullLoader)['actions'][1]
138 slo.iterate_filters(config)
140 ['snap_name', 'snapshot-2015.03.01'], sorted(slo.snapshots))
141 @@ -339,7 +339,7 @@ class TestIterateFiltersSnaps(TestCase):
142 client.snapshot.get.return_value = testvars.snapshots
143 client.snapshot.get_repository.return_value = testvars.test_repo
144 slo = curator.SnapshotList(client, repository=testvars.repo_name)
145 - config = yaml.load(testvars.snap_pattern_ft)['actions'][1]
146 + config = yaml.load(testvars.snap_pattern_ft, Loader=yaml.FullLoader)['actions'][1]
147 slo.iterate_filters(config)
149 ['snap_name', 'snapshot-2015.03.01'], sorted(slo.snapshots))
150 @@ -348,7 +348,7 @@ class TestIterateFiltersSnaps(TestCase):
151 client.snapshot.get.return_value = testvars.snapshots
152 client.snapshot.get_repository.return_value = testvars.test_repo
153 slo = curator.SnapshotList(client, repository=testvars.repo_name)
154 - config = yaml.load(testvars.snap_none_ft)['actions'][1]
155 + config = yaml.load(testvars.snap_none_ft, Loader=yaml.FullLoader)['actions'][1]
156 slo.iterate_filters(config)
158 ['snap_name', 'snapshot-2015.03.01'], sorted(slo.snapshots))