Updates ODL Pipeline scripts for CSIT
[sdnvpn.git] / odl-pipeline / lib / utils / utils_yaml.py
1 #
2 # Copyright (c) 2015 All rights reserved
3 # This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #
10 import yaml
11
12
13 def write_dict_to_yaml(config, path):
14     with open(path, 'w+') as f:
15         yaml.safe_dump(config, f, default_flow_style=False)
16
17
18 def read_dict_from_yaml(path):
19     with open(path, 'r') as f:
20         return yaml.safe_load(f)