def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for target in self.tracked: rel = target.relpath(self._target.directory) sigs[rel] = (self.owner, "dynamic", utils.sign(target)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ target = self.target_file sig = {} if target.exists() and target.isfile(): sig[self.relpath] = (self.current.url, self.kind, utils.sign(self.target_file)) return sig
def sign(self): "" # suppress inherited doc target = self.target_file sig = {} if target.exists() and target.isfile(): sig["layer.yaml"] = (self.layer.url, self.kind, utils.sign(self.target_file)) return sig
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for hook in ["joined", "changed", "broken", "departed"]: target = self._target / "hooks" / "{}-relation-{}".format(self.relation_name, hook) rel = target.relpath(self._target.directory) sigs[rel] = (self.interface.url, "dynamic", utils.sign(target)) return sigs
def sign(self): "" # suppress inherited doc if self.wrote_sha: return { self.target_file.relpath(self.target.directory): (self.layer.url, "dynamic", utils.sign(self.target_file)) } else: return {}
def sign(self): """ Sign all hook files generated by this tactic. """ sigs = {} for target in self.tracked: rel = target.relpath(self._target.directory) sigs[rel] = (self.owner, "dynamic", utils.sign(target)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for target in self.targets: rel = target.relpath(self._target.directory) sigs[rel] = (self.owner, "dynamic", utils.sign(target)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for tactic in self.previous: sigs.update(tactic.sign()) for d in self.tracked: relpath = d.relpath(self.target.directory) sigs[relpath] = (self.current.url, "dynamic", utils.sign(d)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for hook in ['joined', 'changed', 'broken', 'departed']: target = self._target / "hooks" / "{}-relation-{}".format( self.relation_name, hook) rel = target.relpath(self._target.directory) sigs[rel] = (self.interface.url, "dynamic", utils.sign(target)) return sigs
def sign(self): """ Return signatures for the cloud-on-k8s yaml files were added dynamically. """ sigs = {} # Sign ownership of all files this layer created or updated. for d in self.tracked: relpath = d.relpath(self.target.directory) sigs[relpath] = (self.layer.url, "dynamic", utils.sign(d)) return sigs
def sign(self): "" # suppress inherited doc sigs = {} # sign the `copyright` file for all levels below us. for tactic in self.previous: sigs.update(tactic.sign()) relpath = self.target_file.relpath(self.target.directory) sigs[relpath] = (self.layer.url, self.kind, utils.sign(self.target_file)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ if self.wrote_sha: return { self.target_file.relpath(self.target.directory): (self.layer.url, "dynamic", utils.sign(self.target_file)) } else: return {}
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for tactic in self.previous: sigs.update(tactic.sign()) for d in self.tracked: relpath = d.relpath(self.target.directory) sigs[relpath] = ( self.layer.url, "dynamic", utils.sign(d)) return sigs
def sign(self): "" # suppress inherited doc sigs = {} if self.per_layer: for tactic in self.previous: sigs.update(tactic.sign()) else: sigs['wheelhouse.txt'] = ( self.layer.url, "dynamic", utils.sign(self.target.directory / 'wheelhouse.txt'), ) for d in self.tracked: if d in self.removed: continue relpath = d.relpath(self.target.directory) pkg_name = safe_name(d.basename().split('-')[0]) layer_url = self._layer_refs.get(pkg_name, '__pip__') sigs[relpath] = (layer_url, "dynamic", utils.sign(d)) return sigs
def sign(self): "" # suppress inherited doc sigs = {} for tactic in self.previous: sigs.update(tactic.sign()) for d in self.tracked: if d in self.removed: continue relpath = d.relpath(self.target.directory) sigs[relpath] = (self.layer.url, "dynamic", utils.sign(d)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} # sign the `copyright` file for all levels below us. for tactic in self.previous: sigs.update(tactic.sign()) relpath = self.target_file.relpath(self.target.directory) sigs[relpath] = (self.layer.url, self.kind, utils.sign(self.target_file)) return sigs
def sign(self): "" # suppress inherited doc if self.wrote_sha: return { self.target_file.relpath(self.target.directory): ( self.layer.url, "dynamic", utils.sign(self.target_file) ) } else: return {}
def sign(self): "" # suppress inherited doc sigs = {} for d in self._tracked: if d.isdir(): for entry, sig in utils.walk(d, utils.sign, kind="files"): relpath = entry.relpath(self.target.directory) sigs[relpath] = (self.layer.url, "dynamic", sig) elif d.isfile(): relpath = d.relpath(self.target.directory) sigs[relpath] = (self.layer.url, "dynamic", utils.sign(d)) return sigs
def sign(self): "" # suppress inherited doc sigs = {} for tactic in self.previous: sigs.update(tactic.sign()) for d in self.tracked: if d in self.removed: continue relpath = d.relpath(self.target.directory) sigs[relpath] = ( self.layer.url, "dynamic", utils.sign(d)) return sigs
def sign(self): """ Return signature in the form ``{relpath: (origin layer, SHA256)}`` Can be overridden by a subclass, but the default implementation will usually be fine. """ target = self.target_file sig = {} if target.exists() and target.isfile(): sig[self.relpath] = (self.layer.url, self.kind, utils.sign(self.target_file)) return sig
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ sigs = {} for d in self._tracked: if d.isdir(): for entry, sig in utils.walk(d, utils.sign, kind="files"): relpath = entry.relpath(self.target.directory) sigs[relpath] = (self.current.url, "dynamic", sig) elif d.isfile(): relpath = d.relpath(self.target.directory) sigs[relpath] = (self.current.url, "dynamic", utils.sign(d)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} """ if self.wrote_sha: return { self.target_file.relpath(self.target.directory): ( self.layer.url, "dynamic", utils.sign(self.target_file) ) } else: return {}
def sign(self): "" # suppress inherited doc sigs = {} for d in self._tracked: if d.isdir(): for entry, sig in utils.walk(d, utils.sign, kind="files"): relpath = entry.relpath(self.target.directory) sigs[relpath] = (self.layer.url, "dynamic", sig) elif d.isfile(): relpath = d.relpath(self.target.directory) sigs[relpath] = ( self.layer.url, "dynamic", utils.sign(d)) return sigs
def sign(self): """return sign in the form {relpath: (origin layer, SHA256)} This is how the report of changed files is created. """ sigs = {} # recursively have all previous layers sign their files, depth-first for tactic in self.previous: sigs.update(tactic.sign()) # sign ownership of all files this layer created or updated for d in self.tracked: relpath = d.relpath(self.target.directory) sigs[relpath] = (self.layer.url, "dynamic", utils.sign(d)) return sigs