def action_peek_json(body):
 try:
  decoded = jsonutils.loads(body)
 except ValueError:
  msg = _('cannot understand JSON')
  raise exception.MalformedRequestBody(reason=msg)
 if (len(decoded) != 1):
  msg = _('too many body keys')
  raise exception.MalformedRequestBody(reason=msg)
 return list(decoded.keys())[0]

def action_peek_json ( body ) : try : decoded = jsonutils . loads ( body ) except ValueError : msg = _ ( 'cannot understand JSON' ) raise exception . MalformedRequestBody ( reason = msg ) if ( len ( decoded ) != 1 ) : msg = _ ( 'too many body keys' ) raise exception . MalformedRequestBody ( reason = msg ) return list ( decoded . keys ( ) ) [ 0 ]
determine action to invoke .