1 # Copyright (c) 2020 Deutsche Telekom.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 from deprecated import deprecated
16 def yaml_to_dict(filepath):
18 """YAML to Python dict converter.
21 filepath : The filepath to a YAML file.
23 dict : Python dictionary object.
25 with open(filepath, 'rt') as f:
26 return yaml.load(f.read())
29 @deprecated(reason="Will be removed. Call yaml_to_dict(filepath) instead.")
30 def _yaml2Dict(filename):
31 """YAML to dict. See yaml_to_dict(filepath)."""
32 return yaml_to_dict(filename)