commit:     73b9004664d281b9e8bff36f81bf887d5c941d93
Author:     Matteo Contri <matteo.contri <AT> tecem <DOT> it>
AuthorDate: Wed Mar 23 14:42:19 2016 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 15:15:10 2016 +0000
URL:        https://gitweb.gentoo.org/proj/grss.git/commit/?id=73b90046

grs/Rotator.py: make glob stricter

Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 grs/Rotator.py | 5 +++--
 1 file 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()

Reply via email to