Project

General

Profile

Bug #2643

time slider fails due to index exception in zfs.py

Added by Nathan Fiedler almost 8 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
2012-04-20
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Just did a clean install of oi_151a and tried to enable the time slider service (via time-slider-setup in GNOME). It failed due to the following error.

Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
self.run()
File "/usr/lib/../share/time-slider/lib/time_slider/timesliderd.py", line 143, in run
nexttime = self._check_snapshots()
File "/usr/lib/../share/time-slider/lib/time_slider/timesliderd.py", line 450, in _check_snapshots
label = self._take_snapshots(schedule)
File "/usr/lib/../share/time-slider/lib/time_slider/timesliderd.py", line 470, in _take_snapshots
self._datasets.create_auto_snapshot_set(label, tag=schedule)
File "/usr/lib/../share/time-slider/lib/time_slider/zfs.py", line 105, in create_auto_snapshot_set
idx = bisect_right(everything, line0)
IndexError: list index out of range

It seems that this command (zfs list -H -t filesystem,volume -o name,com.sun:auto-snapshot -s name) was returning a number of empty lines and that was messing up the script. I patched the script in two places and it seems to be okay (for now); patch below.

--- zfs.py 2012-04-19 20:55:32.546174005 -0700
++ zfs_new.py 2012-04-19 20:55:18.494126479 -0700
@ -102,6 +102,8 @
outdata,errdata = util.run_command(cmd)
for line in outdata.rstrip().split('\n'):
line = line.split()
if len(line) == 0:
+ continue
idx = bisect_right(everything, line0)
if len(everything) == 0 or \
everything[idx-1] != line0:
@ -196,6 +198,8 @
outdata,errdata = util.run_command(cmd)
for line in outdata.rstrip().split('\n'):
line = line.split()
+ if len(line) == 0:
+ continue # Only set values that aren't already set. Don't override
try:
included.index(line0)

History

#1

Updated by Ken Mays about 7 years ago

  • Status changed from New to Closed

Closed ticket. Resolution provided by user. Update to oi_151a7 and above using JDS updates from pkg.opensolaris.cz:10000. Future updates to time-slider will resolve further issues.

Also available in: Atom PDF