aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatteo Contri <matteo.contri@tecem.it>2016-03-23 15:42:19 +0100
committerAnthony G. Basile <blueness@gentoo.org>2016-03-23 11:15:10 -0400
commit73b9004664d281b9e8bff36f81bf887d5c941d93 (patch)
treedeabed316c67fae0d6692620ae0bddebc741a9b5
parentbin/grsup: dereference sym links so you don't clobber /lib -> /lib64 (diff)
downloadgrss-73b9004664d281b9e8bff36f81bf887d5c941d93.zip
grss-73b9004664d281b9e8bff36f81bf887d5c941d93.tar.gz
grss-73b9004664d281b9e8bff36f81bf887d5c941d93.tar.bz2
grs/Rotator.py: make glob stricter
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--grs/Rotator.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/grs/Rotator.py b/grs/Rotator.py
index a3684a9..f303c14 100644
--- a/grs/Rotator.py
+++ b/grs/Rotator.py
@@ -42,11 +42,12 @@ class Rotator():
obj's paste an upper limit are deleted.
"""
- objs = glob.glob('%s.*' % obj)
+ objs = glob.glob('%s.[0-9]*' % obj)
indexed_obj = {}
for _obj in objs:
_match = re.search(r'^.+\.(\d+)$', _obj)
- indexed_obj[int(_match.group(1))] = _obj
+ if (_match.group(1)):
+ indexed_obj[int(_match.group(1))] = _obj
count = list(indexed_obj.keys())
count.sort()
count.reverse()