Merge lp:~cjwatson/launchpad/livefs-keep-binary-files-interval into lp:launchpad
- livefs-keep-binary-files-interval
- Merge into devel
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 19005 |
Proposed branch: | lp:~cjwatson/launchpad/livefs-keep-binary-files-interval |
Merge into: | lp:launchpad |
Diff against target: |
322 lines (+116/-20) 7 files modified
lib/lp/scripts/garbo.py (+10/-6) lib/lp/scripts/tests/test_garbo.py (+34/-4) lib/lp/soyuz/browser/livefs.py (+8/-2) lib/lp/soyuz/interfaces/livefs.py (+8/-1) lib/lp/soyuz/model/livefs.py (+31/-4) lib/lp/soyuz/tests/test_livefs.py (+21/-1) lib/lp/testing/factory.py (+4/-2) |
To merge this branch: | bzr merge lp:~cjwatson/launchpad/livefs-keep-binary-files-interval |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+368703@code.launchpad.net |
Commit message
Allow configuring the binary file retention period of a LiveFS.
Description of the change
This makes it more practical to deal with live filesystems that are expected to produce base images for use by Launchpad itself. Setting the base image of course ensures that the corresponding LFA stays around, but we may very well want to set a base image from a live filesystem build that's more than a day old.
https:/
To post a comment you must log in.
Revision history for this message
William Grant (wgrant) : | # |
review:
Approve
(code)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/scripts/garbo.py' | |||
2 | --- lib/lp/scripts/garbo.py 2019-01-30 11:23:33 +0000 | |||
3 | +++ lib/lp/scripts/garbo.py 2019-06-12 12:20:38 +0000 | |||
4 | @@ -1566,21 +1566,25 @@ | |||
5 | 1566 | class LiveFSFilePruner(BulkPruner): | 1566 | class LiveFSFilePruner(BulkPruner): |
6 | 1567 | """A BulkPruner to remove old `LiveFSFile`s. | 1567 | """A BulkPruner to remove old `LiveFSFile`s. |
7 | 1568 | 1568 | ||
12 | 1569 | We remove binary files attached to `LiveFSBuild`s that are more than a | 1569 | We remove binary files attached to `LiveFSBuild`s that are more than |
13 | 1570 | day old; these files are very large and are only useful for builds in | 1570 | `LiveFS.keep_binary_files_interval` old; these files are very large and |
14 | 1571 | progress. Text files are typically small (<1MiB) and useful for | 1571 | are only useful for builds in progress. Text files are typically small |
15 | 1572 | retrospective analysis, so we preserve those indefinitely. | 1572 | (<1MiB) and useful for retrospective analysis, so we preserve those |
16 | 1573 | indefinitely. | ||
17 | 1573 | """ | 1574 | """ |
18 | 1574 | target_table_class = LiveFSFile | 1575 | target_table_class = LiveFSFile |
19 | 1576 | # Note that a NULL keep_binary_files_interval disables pruning, due to | ||
20 | 1577 | # SQL NULL propagation. | ||
21 | 1575 | ids_to_prune_query = """ | 1578 | ids_to_prune_query = """ |
22 | 1576 | SELECT DISTINCT LiveFSFile.id | 1579 | SELECT DISTINCT LiveFSFile.id |
24 | 1577 | FROM LiveFSFile, LiveFSBuild, LibraryFileAlias | 1580 | FROM LiveFSFile, LiveFSBuild, LiveFS, LibraryFileAlias |
25 | 1578 | WHERE | 1581 | WHERE |
26 | 1579 | LiveFSFile.livefsbuild = LiveFSBuild.id | 1582 | LiveFSFile.livefsbuild = LiveFSBuild.id |
27 | 1583 | AND LiveFSBuild.livefs = LiveFS.id | ||
28 | 1580 | AND LiveFSFile.libraryfile = LibraryFileAlias.id | 1584 | AND LiveFSFile.libraryfile = LibraryFileAlias.id |
29 | 1581 | AND LiveFSBuild.date_finished < | 1585 | AND LiveFSBuild.date_finished < |
30 | 1582 | CURRENT_TIMESTAMP AT TIME ZONE 'UTC' | 1586 | CURRENT_TIMESTAMP AT TIME ZONE 'UTC' |
32 | 1583 | - CAST('1 day' AS interval) | 1587 | - LiveFS.keep_binary_files_interval |
33 | 1584 | AND LibraryFileAlias.mimetype != 'text/plain' | 1588 | AND LibraryFileAlias.mimetype != 'text/plain' |
34 | 1585 | """ | 1589 | """ |
35 | 1586 | 1590 | ||
36 | 1587 | 1591 | ||
37 | === modified file 'lib/lp/scripts/tests/test_garbo.py' | |||
38 | --- lib/lp/scripts/tests/test_garbo.py 2019-01-30 11:23:33 +0000 | |||
39 | +++ lib/lp/scripts/tests/test_garbo.py 2019-06-12 12:20:38 +0000 | |||
40 | @@ -154,6 +154,9 @@ | |||
41 | 154 | ) | 154 | ) |
42 | 155 | 155 | ||
43 | 156 | 156 | ||
44 | 157 | _default = object() | ||
45 | 158 | |||
46 | 159 | |||
47 | 157 | class TestGarboScript(TestCase): | 160 | class TestGarboScript(TestCase): |
48 | 158 | layer = LaunchpadScriptLayer | 161 | layer = LaunchpadScriptLayer |
49 | 159 | 162 | ||
50 | @@ -1513,18 +1516,25 @@ | |||
51 | 1513 | 'PopulateLatestPersonSourcePackageReleaseCache') | 1516 | 'PopulateLatestPersonSourcePackageReleaseCache') |
52 | 1514 | self.assertEqual(spph_2.id, job_data['last_spph_id']) | 1517 | self.assertEqual(spph_2.id, job_data['last_spph_id']) |
53 | 1515 | 1518 | ||
55 | 1516 | def _test_LiveFSFilePruner(self, content_type, interval, expected_count=0): | 1519 | def _test_LiveFSFilePruner(self, content_type, interval, |
56 | 1520 | keep_binary_files_days=_default, | ||
57 | 1521 | expected_count=0): | ||
58 | 1517 | # Garbo should (or should not, if `expected_count=1`) remove LiveFS | 1522 | # Garbo should (or should not, if `expected_count=1`) remove LiveFS |
59 | 1518 | # files of MIME type `content_type` that finished more than | 1523 | # files of MIME type `content_type` that finished more than |
61 | 1519 | # `interval` days ago. | 1524 | # `interval` days ago. If `keep_binary_files_days` is given, set |
62 | 1525 | # that on the test LiveFS. | ||
63 | 1520 | now = datetime.now(UTC) | 1526 | now = datetime.now(UTC) |
64 | 1521 | switch_dbuser('testadmin') | 1527 | switch_dbuser('testadmin') |
65 | 1522 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: u'on'})) | 1528 | self.useFixture(FeatureFixture({LIVEFS_FEATURE_FLAG: u'on'})) |
66 | 1523 | store = IMasterStore(LiveFSFile) | 1529 | store = IMasterStore(LiveFSFile) |
67 | 1524 | 1530 | ||
68 | 1531 | livefs_kwargs = {} | ||
69 | 1532 | if keep_binary_files_days is not _default: | ||
70 | 1533 | livefs_kwargs['keep_binary_files_days'] = keep_binary_files_days | ||
71 | 1525 | db_build = self.factory.makeLiveFSBuild( | 1534 | db_build = self.factory.makeLiveFSBuild( |
72 | 1526 | date_created=now - timedelta(days=interval, minutes=15), | 1535 | date_created=now - timedelta(days=interval, minutes=15), |
74 | 1527 | status=BuildStatus.FULLYBUILT, duration=timedelta(minutes=10)) | 1536 | status=BuildStatus.FULLYBUILT, duration=timedelta(minutes=10), |
75 | 1537 | **livefs_kwargs) | ||
76 | 1528 | db_lfa = self.factory.makeLibraryFileAlias(content_type=content_type) | 1538 | db_lfa = self.factory.makeLibraryFileAlias(content_type=content_type) |
77 | 1529 | db_file = self.factory.makeLiveFSFile( | 1539 | db_file = self.factory.makeLiveFSFile( |
78 | 1530 | livefsbuild=db_build, libraryfile=db_lfa) | 1540 | livefsbuild=db_build, libraryfile=db_lfa) |
79 | @@ -1537,7 +1547,8 @@ | |||
80 | 1537 | self.assertEqual(expected_count, store.find(LiveFSFile).count()) | 1547 | self.assertEqual(expected_count, store.find(LiveFSFile).count()) |
81 | 1538 | 1548 | ||
82 | 1539 | def test_LiveFSFilePruner_old_binary_files(self): | 1549 | def test_LiveFSFilePruner_old_binary_files(self): |
84 | 1540 | # LiveFS binary files attached to builds over a day old are pruned. | 1550 | # By default, LiveFS binary files attached to builds over a day old |
85 | 1551 | # are pruned. | ||
86 | 1541 | self._test_LiveFSFilePruner('application/octet-stream', 1) | 1552 | self._test_LiveFSFilePruner('application/octet-stream', 1) |
87 | 1542 | 1553 | ||
88 | 1543 | def test_LiveFSFilePruner_old_text_files(self): | 1554 | def test_LiveFSFilePruner_old_text_files(self): |
89 | @@ -1550,6 +1561,25 @@ | |||
90 | 1550 | self._test_LiveFSFilePruner( | 1561 | self._test_LiveFSFilePruner( |
91 | 1551 | 'application/octet-stream', 0, expected_count=1) | 1562 | 'application/octet-stream', 0, expected_count=1) |
92 | 1552 | 1563 | ||
93 | 1564 | def test_LiveFSFilePruner_custom_interval_old_binary_files(self): | ||
94 | 1565 | # If a custom retention interval is set, LiveFS binary files | ||
95 | 1566 | # attached to builds over that interval old are pruned. | ||
96 | 1567 | self._test_LiveFSFilePruner( | ||
97 | 1568 | 'application/octet-stream', 7, keep_binary_files_days=7) | ||
98 | 1569 | |||
99 | 1570 | def test_LiveFSFilePruner_custom_interval_recent_binary_files(self): | ||
100 | 1571 | # If a custom retention interval is set, LiveFS binary files | ||
101 | 1572 | # attached to builds less than that interval old are pruned. | ||
102 | 1573 | self._test_LiveFSFilePruner( | ||
103 | 1574 | 'application/octet-stream', 6, keep_binary_files_days=7, | ||
104 | 1575 | expected_count=1) | ||
105 | 1576 | |||
106 | 1577 | def test_LiveFSFilePruner_null_interval_disables_pruning(self): | ||
107 | 1578 | # A null retention interval disables pruning. | ||
108 | 1579 | self._test_LiveFSFilePruner( | ||
109 | 1580 | 'application/octet-stream', 100, keep_binary_files_days=None, | ||
110 | 1581 | expected_count=1) | ||
111 | 1582 | |||
112 | 1553 | def _test_SnapFilePruner(self, filename, job_status, interval, | 1583 | def _test_SnapFilePruner(self, filename, job_status, interval, |
113 | 1554 | expected_count=0): | 1584 | expected_count=0): |
114 | 1555 | # Garbo should (or should not, if `expected_count=1`) remove snap | 1585 | # Garbo should (or should not, if `expected_count=1`) remove snap |
115 | 1556 | 1586 | ||
116 | === modified file 'lib/lp/soyuz/browser/livefs.py' | |||
117 | --- lib/lp/soyuz/browser/livefs.py 2018-07-16 00:51:23 +0000 | |||
118 | +++ lib/lp/soyuz/browser/livefs.py 2019-06-12 12:20:38 +0000 | |||
119 | @@ -1,4 +1,4 @@ | |||
121 | 1 | # Copyright 2014-2018 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2019 Canonical Ltd. This software is licensed under the |
122 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
123 | 3 | 3 | ||
124 | 4 | """LiveFS views.""" | 4 | """LiveFS views.""" |
125 | @@ -181,6 +181,7 @@ | |||
126 | 181 | 'name', | 181 | 'name', |
127 | 182 | 'require_virtualized', | 182 | 'require_virtualized', |
128 | 183 | 'relative_build_score', | 183 | 'relative_build_score', |
129 | 184 | 'keep_binary_files_days', | ||
130 | 184 | ]) | 185 | ]) |
131 | 185 | distro_series = Choice( | 186 | distro_series = Choice( |
132 | 186 | vocabulary='BuildableDistroSeries', title=u'Distribution series') | 187 | vocabulary='BuildableDistroSeries', title=u'Distribution series') |
133 | @@ -282,13 +283,18 @@ | |||
134 | 282 | 283 | ||
135 | 283 | label = title | 284 | label = title |
136 | 284 | 285 | ||
138 | 285 | field_names = ['require_virtualized', 'relative_build_score'] | 286 | field_names = [ |
139 | 287 | 'require_virtualized', | ||
140 | 288 | 'relative_build_score', | ||
141 | 289 | 'keep_binary_files_days', | ||
142 | 290 | ] | ||
143 | 286 | 291 | ||
144 | 287 | @property | 292 | @property |
145 | 288 | def initial_values(self): | 293 | def initial_values(self): |
146 | 289 | return { | 294 | return { |
147 | 290 | 'require_virtualized': self.context.require_virtualized, | 295 | 'require_virtualized': self.context.require_virtualized, |
148 | 291 | 'relative_build_score': self.context.relative_build_score, | 296 | 'relative_build_score': self.context.relative_build_score, |
149 | 297 | 'keep_binary_files_days': self.context.keep_binary_files_days, | ||
150 | 292 | } | 298 | } |
151 | 293 | 299 | ||
152 | 294 | 300 | ||
153 | 295 | 301 | ||
154 | === modified file 'lib/lp/soyuz/interfaces/livefs.py' | |||
155 | --- lib/lp/soyuz/interfaces/livefs.py 2017-07-18 16:22:03 +0000 | |||
156 | +++ lib/lp/soyuz/interfaces/livefs.py 2019-06-12 12:20:38 +0000 | |||
157 | @@ -1,4 +1,4 @@ | |||
159 | 1 | # Copyright 2014-2017 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2019 Canonical Ltd. This software is licensed under the |
160 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
161 | 3 | 3 | ||
162 | 4 | """Live filesystem interfaces.""" | 4 | """Live filesystem interfaces.""" |
163 | @@ -262,6 +262,13 @@ | |||
164 | 262 | "A delta to apply to all build scores for the live filesystem. " | 262 | "A delta to apply to all build scores for the live filesystem. " |
165 | 263 | "Builds with a higher score will build sooner."))) | 263 | "Builds with a higher score will build sooner."))) |
166 | 264 | 264 | ||
167 | 265 | keep_binary_files_days = exported(Int( | ||
168 | 266 | title=_("Binary file retention period"), | ||
169 | 267 | required=False, readonly=False, | ||
170 | 268 | description=_( | ||
171 | 269 | "Keep binary files attached to builds of this live filesystem " | ||
172 | 270 | "for at least this many days. If unset, disable pruning."))) | ||
173 | 271 | |||
174 | 265 | 272 | ||
175 | 266 | class ILiveFSAdminAttributes(Interface): | 273 | class ILiveFSAdminAttributes(Interface): |
176 | 267 | """`ILiveFS` attributes that can be edited by admins. | 274 | """`ILiveFS` attributes that can be edited by admins. |
177 | 268 | 275 | ||
178 | === modified file 'lib/lp/soyuz/model/livefs.py' | |||
179 | --- lib/lp/soyuz/model/livefs.py 2017-07-18 16:22:03 +0000 | |||
180 | +++ lib/lp/soyuz/model/livefs.py 2019-06-12 12:20:38 +0000 | |||
181 | @@ -1,4 +1,4 @@ | |||
183 | 1 | # Copyright 2014-2017 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2019 Canonical Ltd. This software is licensed under the |
184 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
185 | 3 | 3 | ||
186 | 4 | __metaclass__ = type | 4 | __metaclass__ = type |
187 | @@ -6,6 +6,9 @@ | |||
188 | 6 | 'LiveFS', | 6 | 'LiveFS', |
189 | 7 | ] | 7 | ] |
190 | 8 | 8 | ||
191 | 9 | from datetime import timedelta | ||
192 | 10 | import math | ||
193 | 11 | |||
194 | 9 | import pytz | 12 | import pytz |
195 | 10 | from storm.locals import ( | 13 | from storm.locals import ( |
196 | 11 | Bool, | 14 | Bool, |
197 | @@ -17,6 +20,7 @@ | |||
198 | 17 | Reference, | 20 | Reference, |
199 | 18 | Store, | 21 | Store, |
200 | 19 | Storm, | 22 | Storm, |
201 | 23 | TimeDelta, | ||
202 | 20 | Unicode, | 24 | Unicode, |
203 | 21 | ) | 25 | ) |
204 | 22 | from zope.component import getUtility | 26 | from zope.component import getUtility |
205 | @@ -113,8 +117,12 @@ | |||
206 | 113 | 117 | ||
207 | 114 | relative_build_score = Int(name='relative_build_score', allow_none=False) | 118 | relative_build_score = Int(name='relative_build_score', allow_none=False) |
208 | 115 | 119 | ||
209 | 120 | keep_binary_files_interval = TimeDelta( | ||
210 | 121 | name='keep_binary_files_interval', allow_none=True) | ||
211 | 122 | |||
212 | 116 | def __init__(self, registrant, owner, distro_series, name, | 123 | def __init__(self, registrant, owner, distro_series, name, |
214 | 117 | metadata, require_virtualized, date_created): | 124 | metadata, require_virtualized, keep_binary_files_days, |
215 | 125 | date_created): | ||
216 | 118 | """Construct a `LiveFS`.""" | 126 | """Construct a `LiveFS`.""" |
217 | 119 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): | 127 | if not getFeatureFlag(LIVEFS_FEATURE_FLAG): |
218 | 120 | raise LiveFSFeatureDisabled | 128 | raise LiveFSFeatureDisabled |
219 | @@ -128,6 +136,24 @@ | |||
220 | 128 | self.relative_build_score = 0 | 136 | self.relative_build_score = 0 |
221 | 129 | self.date_created = date_created | 137 | self.date_created = date_created |
222 | 130 | self.date_last_modified = date_created | 138 | self.date_last_modified = date_created |
223 | 139 | self.keep_binary_files_days = keep_binary_files_days | ||
224 | 140 | |||
225 | 141 | @property | ||
226 | 142 | def keep_binary_files_days(self): | ||
227 | 143 | """See `ILiveFS`.""" | ||
228 | 144 | # Rounding up preserves the "at least this many days" part of the | ||
229 | 145 | # contract, and makes the interface simpler. | ||
230 | 146 | if self.keep_binary_files_interval is not None: | ||
231 | 147 | return int(math.ceil( | ||
232 | 148 | self.keep_binary_files_interval.total_seconds() / 86400)) | ||
233 | 149 | else: | ||
234 | 150 | return None | ||
235 | 151 | |||
236 | 152 | @keep_binary_files_days.setter | ||
237 | 153 | def keep_binary_files_days(self, days): | ||
238 | 154 | """See `ILiveFS`.""" | ||
239 | 155 | self.keep_binary_files_interval = ( | ||
240 | 156 | timedelta(days=days) if days is not None else None) | ||
241 | 131 | 157 | ||
242 | 132 | def requestBuild(self, requester, archive, distro_arch_series, pocket, | 158 | def requestBuild(self, requester, archive, distro_arch_series, pocket, |
243 | 133 | unique_key=None, metadata_override=None, version=None): | 159 | unique_key=None, metadata_override=None, version=None): |
244 | @@ -230,7 +256,8 @@ | |||
245 | 230 | """See `ILiveFSSet`.""" | 256 | """See `ILiveFSSet`.""" |
246 | 231 | 257 | ||
247 | 232 | def new(self, registrant, owner, distro_series, name, metadata, | 258 | def new(self, registrant, owner, distro_series, name, metadata, |
249 | 233 | require_virtualized=True, date_created=DEFAULT): | 259 | require_virtualized=True, keep_binary_files_days=1, |
250 | 260 | date_created=DEFAULT): | ||
251 | 234 | """See `ILiveFSSet`.""" | 261 | """See `ILiveFSSet`.""" |
252 | 235 | if not registrant.inTeam(owner): | 262 | if not registrant.inTeam(owner): |
253 | 236 | if owner.is_team: | 263 | if owner.is_team: |
254 | @@ -248,7 +275,7 @@ | |||
255 | 248 | store = IMasterStore(LiveFS) | 275 | store = IMasterStore(LiveFS) |
256 | 249 | livefs = LiveFS( | 276 | livefs = LiveFS( |
257 | 250 | registrant, owner, distro_series, name, metadata, | 277 | registrant, owner, distro_series, name, metadata, |
259 | 251 | require_virtualized, date_created) | 278 | require_virtualized, keep_binary_files_days, date_created) |
260 | 252 | store.add(livefs) | 279 | store.add(livefs) |
261 | 253 | 280 | ||
262 | 254 | return livefs | 281 | return livefs |
263 | 255 | 282 | ||
264 | === modified file 'lib/lp/soyuz/tests/test_livefs.py' | |||
265 | --- lib/lp/soyuz/tests/test_livefs.py 2019-01-25 11:47:20 +0000 | |||
266 | +++ lib/lp/soyuz/tests/test_livefs.py 2019-06-12 12:20:38 +0000 | |||
267 | @@ -1,4 +1,4 @@ | |||
269 | 1 | # Copyright 2014-2018 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2014-2019 Canonical Ltd. This software is licensed under the |
270 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). |
271 | 3 | 3 | ||
272 | 4 | """Test live filesystems.""" | 4 | """Test live filesystems.""" |
273 | @@ -122,6 +122,26 @@ | |||
274 | 122 | with celebrity_logged_in("buildd_admin"): | 122 | with celebrity_logged_in("buildd_admin"): |
275 | 123 | livefs.relative_build_score = 100 | 123 | livefs.relative_build_score = 100 |
276 | 124 | 124 | ||
277 | 125 | def test_keep_binary_files_days(self): | ||
278 | 126 | # Buildd admins can change the binary file retention period of a | ||
279 | 127 | # LiveFS, but ordinary users cannot. | ||
280 | 128 | livefs = self.factory.makeLiveFS() | ||
281 | 129 | self.assertEqual(1, livefs.keep_binary_files_days) | ||
282 | 130 | with person_logged_in(livefs.owner): | ||
283 | 131 | self.assertRaises( | ||
284 | 132 | Unauthorized, setattr, livefs, "keep_binary_files_days", 2) | ||
285 | 133 | with celebrity_logged_in("buildd_admin"): | ||
286 | 134 | livefs.keep_binary_files_days = 2 | ||
287 | 135 | self.assertEqual(2, livefs.keep_binary_files_days) | ||
288 | 136 | self.assertEqual( | ||
289 | 137 | timedelta(days=2), | ||
290 | 138 | removeSecurityProxy(livefs).keep_binary_files_interval) | ||
291 | 139 | with celebrity_logged_in("buildd_admin"): | ||
292 | 140 | livefs.keep_binary_files_days = None | ||
293 | 141 | self.assertIsNone(livefs.keep_binary_files_days) | ||
294 | 142 | self.assertIsNone( | ||
295 | 143 | removeSecurityProxy(livefs).keep_binary_files_interval) | ||
296 | 144 | |||
297 | 125 | def test_requestBuild(self): | 145 | def test_requestBuild(self): |
298 | 126 | # requestBuild creates a new LiveFSBuild. | 146 | # requestBuild creates a new LiveFSBuild. |
299 | 127 | livefs = self.factory.makeLiveFS() | 147 | livefs = self.factory.makeLiveFS() |
300 | 128 | 148 | ||
301 | === modified file 'lib/lp/testing/factory.py' | |||
302 | --- lib/lp/testing/factory.py 2019-05-06 14:22:34 +0000 | |||
303 | +++ lib/lp/testing/factory.py 2019-06-12 12:20:38 +0000 | |||
304 | @@ -4628,7 +4628,7 @@ | |||
305 | 4628 | 4628 | ||
306 | 4629 | def makeLiveFS(self, registrant=None, owner=None, distroseries=None, | 4629 | def makeLiveFS(self, registrant=None, owner=None, distroseries=None, |
307 | 4630 | name=None, metadata=None, require_virtualized=True, | 4630 | name=None, metadata=None, require_virtualized=True, |
309 | 4631 | date_created=DEFAULT): | 4631 | keep_binary_files_days=1, date_created=DEFAULT): |
310 | 4632 | """Make a new LiveFS.""" | 4632 | """Make a new LiveFS.""" |
311 | 4633 | if registrant is None: | 4633 | if registrant is None: |
312 | 4634 | registrant = self.makePerson() | 4634 | registrant = self.makePerson() |
313 | @@ -4642,7 +4642,9 @@ | |||
314 | 4642 | metadata = {} | 4642 | metadata = {} |
315 | 4643 | livefs = getUtility(ILiveFSSet).new( | 4643 | livefs = getUtility(ILiveFSSet).new( |
316 | 4644 | registrant, owner, distroseries, name, metadata, | 4644 | registrant, owner, distroseries, name, metadata, |
318 | 4645 | require_virtualized=require_virtualized, date_created=date_created) | 4645 | require_virtualized=require_virtualized, |
319 | 4646 | keep_binary_files_days=keep_binary_files_days, | ||
320 | 4647 | date_created=date_created) | ||
321 | 4646 | IStore(livefs).flush() | 4648 | IStore(livefs).flush() |
322 | 4647 | return livefs | 4649 | return livefs |
323 | 4648 | 4650 |