def precheck(context):
  """
  calls a function named "precheck_<key>" where <key> is context_key with '-' changed to '_'
  (e.g. "precheck_ami_id")
  Checking function should return True if OK, or raise RuntimeError w/ message if not
  Args:
    context: a populated EFVersionContext object
  Returns:
    True if the precheck passed, or if there was no precheck function for context.key
  Raises:
    RuntimeError if precheck failed, with explanatory message
  """
  if context.noprecheck:
    return True
  func_name = "precheck_" + context.key.replace("-", "_")
  if func_name in globals() and isfunction(globals()[func_name]):
    return globals()[func_name](context)
  else:
    return True
def precheck ( context ) : if context . noprecheck : return True func_name = "precheck_" + context . key . replace ( "-" , "_" ) if func_name in globals ( ) and isfunction ( globals ( ) [ func_name ] ) : return globals ( ) [ func_name ] ( context ) else : return True
calls a function named "precheck_<key>" where <key> is context_key with '-' changed to '_'
  (e.g. "precheck_ami_id")
  Checking function should return True if OK, or raise RuntimeError w/ message if not
  Args:
    context: a populated EFVersionContext object
  Returns:
    True if the precheck passed, or if there was no precheck function for context.key
  Raises:
    RuntimeError if precheck failed, with explanatory message