aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elivepatch_client/client/checkers.py20
-rw-r--r--elivepatch_client/client/cli.py1
2 files changed, 5 insertions, 16 deletions
diff --git a/elivepatch_client/client/checkers.py b/elivepatch_client/client/checkers.py
index 931d4ab..b3bad95 100644
--- a/elivepatch_client/client/checkers.py
+++ b/elivepatch_client/client/checkers.py
@@ -21,17 +21,10 @@ class Kernel(object):
self.config = ''
self.patch = ''
self.url = url
- self.kernel_version = self.get_version()
+ self.kernel_version = None
self.rest_manager = restful.ManaGer(url, self.kernel_version)
self.UserID = None
- def get_version(self):
- tmp = os.uname()[2]
- version = tmp
- if '-' in version:
- version = version.split('-')[0]
- return version
-
def set_config(self, config_path):
self.config = config_path
@@ -39,10 +32,6 @@ class Kernel(object):
self.patch = patch_path
def send_files(self):
- # debug print
- print('conifg path: '+ str(self.config) + 'server url: ' + str(self. url))
- print (os.path.basename(self.config))
-
# check the configuration file
path, file = (os.path.split(self.config))
f_action = FileAction(path, file)
@@ -51,10 +40,11 @@ class Kernel(object):
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)
- print(self.config)
+
+ # Get kernel version from the configuration file header
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())
+ print('debug: kernel version =' + self.rest_manager.get_kernel_version())
path, patch_file = (os.path.split(self.patch))
@@ -69,7 +59,7 @@ class Kernel(object):
old_userid = None
print('no UserID')
- # send only uncompressed config
+ # send uncompressed config and patch files
replay = self.rest_manager.send_file(self.config, self.patch, file, patch_file, '/elivepatch/api/v1.0/get_files')
# get userid returned from the server
diff --git a/elivepatch_client/client/cli.py b/elivepatch_client/client/cli.py
index 6823344..a0300d1 100644
--- a/elivepatch_client/client/cli.py
+++ b/elivepatch_client/client/cli.py
@@ -30,7 +30,6 @@ class Main(object):
if config.cve:
print('working on cve')
elif config.patch:
- print('working with patch')
current_kernel = Kernel(config.url)
current_kernel.set_config(config.config)
current_kernel.set_patch(config.patch)