aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ferrazzi <alicef@gentoo.org>2017-07-01 01:49:09 +0900
committerAlice Ferrazzi <alicef@gentoo.org>2017-07-01 01:49:09 +0900
commit70e03c4a5054cdb8b11e8c1d0caa8887d44838b4 (patch)
tree6e8694d2872b3403c29c50948383ae9e0114d05d
parentfix shadowing reserved keyword (diff)
downloadelivepatch-70e03c4a5054cdb8b11e8c1d0caa8887d44838b4.tar.gz
elivepatch-70e03c4a5054cdb8b11e8c1d0caa8887d44838b4.tar.bz2
elivepatch-70e03c4a5054cdb8b11e8c1d0caa8887d44838b4.zip
checking file extension using regular expression
-rw-r--r--elivepatch_client/client/checkers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/elivepatch_client/client/checkers.py b/elivepatch_client/client/checkers.py
index 7ff5af8..d3c784e 100644
--- a/elivepatch_client/client/checkers.py
+++ b/elivepatch_client/client/checkers.py
@@ -10,6 +10,7 @@ from elivepatch_client.client import restful
import gzip
import os
import os.path
+import re
class Kernel(object):
@@ -39,8 +40,7 @@ class Kernel(object):
print('conifg path: '+ str(self.config) + 'server url: ' + str(url))
print (os.path.basename(self.config))
path, file = (os.path.split(self.config))
- file_extension = os.path.splitext(file)[1]
- if file_extension == ".gz":
+ if re.findall("[.]gz\Z", self.config):
print('gz extension')
f_action = FileAction(path, file)
path, file = f_action.ungz()