← Back to team overview

livepatch-charmers team mailing list archive

[Merge] ~pjdc/canonical-livepatch-charm/+git/mojo-spec:use-yaml-safe-load into canonical-livepatch-charm:master

 

Paul Collins has proposed merging ~pjdc/canonical-livepatch-charm/+git/mojo-spec:use-yaml-safe-load into canonical-livepatch-charm:master.

Requested reviews:
  Livepatch charm developers (livepatch-charmers)

For more details, see:
https://code.launchpad.net/~pjdc/canonical-livepatch-charm/+git/mojo-spec/+merge/348729
-- 
Your team Livepatch charm developers is requested to review the proposed merge of ~pjdc/canonical-livepatch-charm/+git/mojo-spec:use-yaml-safe-load into canonical-livepatch-charm:master.
diff --git a/reactive/canonical_livepatch.py b/reactive/canonical_livepatch.py
index 21a0f4d..22152a6 100644
--- a/reactive/canonical_livepatch.py
+++ b/reactive/canonical_livepatch.py
@@ -7,7 +7,7 @@ from charmhelpers.contrib.charmsupport import nrpe
 from subprocess import check_call, check_output, CalledProcessError
 from time import sleep
 from os import environ, path, uname
-from yaml import load
+from yaml import safe_load
 from distutils.version import LooseVersion
 
 
@@ -65,7 +65,7 @@ def get_patch_details():
 
     # status will usually pass YAML (but not always!)
     try:
-        status_yaml = load(livepatch_state)
+        status_yaml = safe_load(livepatch_state)
     except Exception:
         hookenv.log('Unable to parse status yaml', hookenv.ERROR)
         return kernel, patch_state