diff --git a/os_api_ref/__init__.py b/os_api_ref/__init__.py index faa859a..f427fd8 100644 --- a/os_api_ref/__init__.py +++ b/os_api_ref/__init__.py @@ -65,7 +65,8 @@ in both naming and ordering of parameters at every declaration. """ -def ordered_load(stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict): +def ordered_load( + stream, Loader=yaml.SafeLoader, object_pairs_hook=OrderedDict): """Load yaml as an ordered dict This allows us to inspect the order of the file on disk to make @@ -299,7 +300,7 @@ class RestParametersDirective(Table): return content = "\n".join(self.content) - parsed = yaml.load(content) + parsed = yaml.safe_load(content) # self.app.info("Params loaded is %s" % parsed) # self.app.info("Lookup table looks like %s" % lookup) new_content = list() diff --git a/os_api_ref/http_codes.py b/os_api_ref/http_codes.py index d69847c..317be89 100644 --- a/os_api_ref/http_codes.py +++ b/os_api_ref/http_codes.py @@ -47,7 +47,7 @@ class HTTPResponseCodeDirective(Table): # self.app.info("Fpath: %s" % fpath) try: with open(fpath, 'r') as stream: - lookup = yaml.load(stream) + lookup = yaml.safe_load(stream) except IOError: self.env.warn( self.env.docname, @@ -124,7 +124,7 @@ class HTTPResponseCodeDirective(Table): def _load_codes(self): content = "\n".join(self.content) - parsed = yaml.load(content) + parsed = yaml.safe_load(content) new_content = list()