Browse Source

safe yaml loading

Fabian Peter Hammerle 4 years ago
parent
commit
1e3d659587
2 changed files with 18 additions and 2 deletions
  1. 14 0
      CHANGELOG.md
  2. 4 2
      scripts/tooncher

+ 14 - 0
CHANGELOG.md

@@ -0,0 +1,14 @@
+# Changelog
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+
+## [Unreleased]
+### Fixed
+- `YAMLLoadWarning: […] the default Loader is unsafe. […]`
+
+## [0.4.0] - 2017-10-31
+
+[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.4.0...HEAD
+[0.4.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.1...v0.4.0

+ 4 - 2
scripts/tooncher

@@ -3,16 +3,18 @@
 
 import os
 import sys
-import tooncher
+
 import yaml
 
+import tooncher
+
 
 def run(username, config_path, engine_path=None, validate_ssl_certs=True,
         cpu_limit_percent=None):
 
     if os.path.exists(config_path):
         with open(config_path) as f:
-            config = yaml.load(f.read())
+            config = yaml.safe_load(f.read())
     else:
         config = {}