def _get_flavor_image_meta(key, flavor, image_meta):
 flavor_key = ':'.join(['hw', key])
 image_key = '_'.join(['hw', key])
 flavor_policy = flavor.get('extra_specs', {}).get(flavor_key)
 image_policy = image_meta.properties.get(image_key)
 return (flavor_policy, image_policy)

def _get_flavor_image_meta ( key , flavor , image_meta ) : flavor_key = ':' . join ( [ 'hw' , key ] ) image_key = '_' . join ( [ 'hw' , key ] ) flavor_policy = flavor . get ( 'extra_specs' , { } ) . get ( flavor_key ) image_policy = image_meta . properties . get ( image_key ) return ( flavor_policy , image_policy )
extract both flavor- and image-based variants of metadata .