aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ferrazzi <alicef@gentoo.org>2017-07-05 09:49:46 +0000
committerAlice Ferrazzi <alicef@gentoo.org>2017-07-05 09:49:46 +0000
commitca601189b6d881d70447d43c5c4be83b4d758935 (patch)
tree6c25d5e462c7e13f19ca3eadfbbca96866dacb5c
parentGetting kernel version from config file (diff)
downloadelivepatch-ca601189b6d881d70447d43c5c4be83b4d758935.tar.gz
elivepatch-ca601189b6d881d70447d43c5c4be83b4d758935.tar.bz2
elivepatch-ca601189b6d881d70447d43c5c4be83b4d758935.zip
getting version from config file
-rw-r--r--elivepatch_client/client/checkers.py7
-rw-r--r--elivepatch_client/client/restful.py6
2 files changed, 11 insertions, 2 deletions
diff --git a/elivepatch_client/client/checkers.py b/elivepatch_client/client/checkers.py
index 5a046de..1a7db40 100644
--- a/elivepatch_client/client/checkers.py
+++ b/elivepatch_client/client/checkers.py
@@ -45,13 +45,16 @@ class Kernel(object):
# check the configuration file
path, file = (os.path.split(self.config))
+ f_action = FileAction(path, file)
if re.findall("[.]gz\Z", self.config):
print('gz extension')
- f_action = FileAction(path, file)
path, file = f_action.ungz()
# if the file is .gz the configuration path is the tmp folder uncompressed config file
self.config = os.path.join(path,file)
- self.kernel_version = f_action.config_kernel_version(self.config)
+ print(self.config)
+ self.kernel_version = f_action.config_kernel_version(self.config)
+ self.rest_manager.set_kernel_version(self.kernel_version)
+ print(self.rest_manager.get_kernel_version())
# check userID
diff --git a/elivepatch_client/client/restful.py b/elivepatch_client/client/restful.py
index beadd4f..8dff862 100644
--- a/elivepatch_client/client/restful.py
+++ b/elivepatch_client/client/restful.py
@@ -17,6 +17,12 @@ class ManaGer(object):
def set_user_id(self, user_id):
self.user_id = user_id
+
+ def set_kernel_version(self, kernel_version):
+ self.kernel_version = kernel_version
+
+ def get_kernel_version(self):
+ return self.kernel_version
def get_user_id(self):
return self.user_id