Skip to content

Commit d807139

Browse files
committedJul 3, 2019
Excise more OSTree pruning leftovers
Minor follow-ups from the OSTree-in-builddir work. - prune_builds: we don't need to remember the `ostree_timestamp` anymore when collecting builds. - prune_builds: drop the `subprocess` module, since we no longer need to call out to the `ostree` CLI either. - cmd-clean: drop the reference to OSTree repo objects
1 parent 9178b55 commit d807139

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed
 

‎src/cmd-clean

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,5 @@ prepare_build
5151

5252
# But go back to the toplevel
5353
cd "${workdir:?}"
54-
# Note we don't prune the cache.qcow2 or the objects
55-
# in the repo. If you want that, just rm -rf them.
54+
# Note we don't prune the cache. If you want that, just rm -rf them.
5655
rm -rf builds/* tmp/*

‎src/prune_builds

+2-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import sys
1111
import json
1212
import shutil
1313
import argparse
14-
import subprocess
1514
import collections
1615

1716
from datetime import timedelta, datetime, timezone
@@ -35,8 +34,7 @@ def parse_date_string(date_string):
3534
return dt.replace(tzinfo=timezone.utc)
3635

3736

38-
Build = collections.namedtuple('Build', ['id', 'timestamp',
39-
'ostree_timestamp'])
37+
Build = collections.namedtuple('Build', ['id', 'timestamp'])
4038

4139
# Let's just hardcode this here for now
4240
DEFAULT_KEEP_LAST_N = 3
@@ -115,10 +113,7 @@ with os.scandir(builds_dir) as it:
115113
# Older versions only had ostree-timestamp
116114
ts = j.get('coreos-assembler.build-timestamp') or j['ostree-timestamp']
117115
t = parse_date_string(ts)
118-
ostree_ts = j['ostree-timestamp']
119-
ostree_t = parse_date_string(ostree_ts)
120-
builds.append(Build(id=entry.name, timestamp=t,
121-
ostree_timestamp=ostree_t))
116+
builds.append(Build(id=entry.name, timestamp=t))
122117

123118
# just get the trivial case out of the way
124119
if len(builds) == 0:

0 commit comments

Comments
 (0)