def GetArtifact(self, name): """Get artifact by name. Args: name: artifact name string. Returns: artifact object. Raises: ArtifactNotRegisteredError: if artifact doesn't exist in the registy. """ self._CheckDirty() result = self._artifacts.get(name) if not result: raise rdf_artifacts.ArtifactNotRegisteredError( "Artifact %s missing from registry. You may need to sync the " "artifact repo by running make in the artifact directory." % name) return result
def GetArtifact(self, name): """Get artifact by name. Args: name: artifact name string. Returns: artifact object. Raises: ArtifactNotRegisteredError: if artifact doesn't exist in the registy. """ self._CheckDirty() result = self._artifacts.get(name) if not result: # If we don't have an artifact, things shouldn't have passed validation # so we assume its a new one in the datastore. REGISTRY.ReloadDatastoreArtifacts() result = self._artifacts.get(name) if not result: raise rdf_artifacts.ArtifactNotRegisteredError( "Artifact %s missing from registry. You may need " "to sync the artifact repo by running make in the artifact " "directory." % name) return result