1 2 3 4 5 6 7 8 9 10 11 12
#!/usr/bin/env python import yaml def get(config,result): dc_config = yaml.load(file(config["file"], 'r')) for dc in dc_config: if result.has_key(dc): result[dc].update(dc_config[dc]) else: result[dc] = dc_config[dc] return result