diff options
author | Alice Ferrazzi <alicef@gentoo.org> | 2017-07-24 11:20:23 +0900 |
---|---|---|
committer | Alice Ferrazzi <alicef@gentoo.org> | 2017-07-24 11:20:23 +0900 |
commit | 390da3357723dd6680dd17d1ecf7571616e209c9 (patch) | |
tree | e490dde9d3d9d7b8ef054e6186378bd10d16777b /elivepatch_client | |
parent | adding debug_info to the configuration file if not setted (diff) | |
download | elivepatch-390da3357723dd6680dd17d1ecf7571616e209c9.tar.gz elivepatch-390da3357723dd6680dd17d1ecf7571616e209c9.tar.bz2 elivepatch-390da3357723dd6680dd17d1ecf7571616e209c9.zip |
catch missing livepatch errors on the client
Diffstat (limited to 'elivepatch_client')
-rw-r--r-- | elivepatch_client/client/restful.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/elivepatch_client/client/restful.py b/elivepatch_client/client/restful.py index 517af44..fa6c583 100644 --- a/elivepatch_client/client/restful.py +++ b/elivepatch_client/client/restful.py @@ -85,7 +85,11 @@ class ManaGer(object): print('livepatch not found') r.close() - elivepatch_uuid_dir = os.path.join('..', 'elivepatch-'+ self.uuid) - if not os.path.exists(elivepatch_uuid_dir): - os.makedirs(elivepatch_uuid_dir) - shutil.move("myfile.ko", os.path.join(elivepatch_uuid_dir, 'livepatch.ko')) + if os.path.exists('myfile.ko'): + elivepatch_uuid_dir = os.path.join('..', 'elivepatch-'+ self.uuid) + if not os.path.exists(elivepatch_uuid_dir): + os.makedirs(elivepatch_uuid_dir) + shutil.move("myfile.ko", os.path.join(elivepatch_uuid_dir, 'livepatch.ko')) + print('livepatch saved in ' + elivepatch_uuid_dir + '/ folder') + else: + print('livepatch not received') |