def CheckImageValidity(image, error_message):
  if image is not None and not (utils.IsUrl(image) or os.path.isabs(image)):
    raise errors.OpPrereqError(error_message)
Checks if a given image description is either a valid file path or a URL.
dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/common.py/CheckImageValidity