@transform_exception(ex.RemoteCommandException, p_ex.ImageValidationError)
    def validate(self, remote, reconcile=True, env_map=None, **kwargs):
        env_distro = env_map[self.DISTRO_KEY]
        env_family = self._DISTRO_FAMILES[env_distro]
        check, install = self._DISTRO_TOOLS[env_family]
        if not env_family:
            raise p_ex.ImageValidationError(
                _("Unknown distro: cannot verify or install packages."))
        try:
            check(self, remote)
        except (ex.SubprocessException, ex.RemoteCommandException):
            if reconcile:
                install(self, remote)
                check(self, remote)
            else:
                raise
Turn a key stored in the database into a Key or None.
dataset/ETHPy150Open openstack/sahara/sahara/plugins/images.py/SaharaPackageValidator.validate--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/bulkloader.py/ParseKey