def _extract_inventories(body, schema):
 data = util.extract_json(body, schema)
 inventories = {}
 for (res_class, raw_inventory) in data['inventories'].items():
  inventory_data = copy.copy(INVENTORY_DEFAULTS)
  inventory_data.update(raw_inventory)
  inventories[res_class] = inventory_data
 data['inventories'] = inventories
 return data

def _extract_inventories ( body , schema ) : data = util . extract_json ( body , schema ) inventories = { } for ( res_class , raw_inventory ) in data [ 'inventories' ] . items ( ) : inventory_data = copy . copy ( INVENTORY_DEFAULTS ) inventory_data . update ( raw_inventory ) inventories [ res_class ] = inventory_data data [ 'inventories' ] = inventories return data
extract and validate multiple inventories from json body .