mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
repository: Rename snapshot()/timestamp()
New names: do_snapshot() do_timestamp() This is in preparation of using the old names for another purpose. Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
This commit is contained in:
parent
0262a8ac49
commit
c3411dc59e
2 changed files with 12 additions and 8 deletions
|
|
@ -133,8 +133,8 @@ def add_target(self, path: str, content: str) -> None:
|
|||
logger.debug("Targets v%d", targets.version)
|
||||
|
||||
# update snapshot, timestamp
|
||||
self.snapshot()
|
||||
self.timestamp()
|
||||
self.do_snapshot()
|
||||
self.do_timestamp()
|
||||
|
||||
def submit_delegation(self, rolename: str, data: bytes) -> bool:
|
||||
"""Add a delegation to a (offline signed) delegated targets metadata"""
|
||||
|
|
@ -159,8 +159,8 @@ def submit_delegation(self, rolename: str, data: bytes) -> bool:
|
|||
logger.debug("Targets v%d", targets.version)
|
||||
|
||||
# update snapshot, timestamp
|
||||
self.snapshot()
|
||||
self.timestamp()
|
||||
self.do_snapshot()
|
||||
self.do_timestamp()
|
||||
|
||||
return True
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ def submit_role(self, role: str, data: bytes) -> bool:
|
|||
self.target_cache[targetpath] = bytes(f"{targetpath}", "utf-8")
|
||||
|
||||
# update snapshot, timestamp
|
||||
self.snapshot()
|
||||
self.timestamp()
|
||||
self.do_snapshot()
|
||||
self.do_timestamp()
|
||||
|
||||
return True
|
||||
|
|
|
|||
|
|
@ -134,7 +134,9 @@ def edit_targets(self, rolename: str) -> Generator[Targets, None, None]:
|
|||
raise RuntimeError(f"Unexpected Targets ({rolename}) type")
|
||||
yield targets
|
||||
|
||||
def snapshot(self, force: bool = False) -> Tuple[bool, Dict[str, MetaFile]]:
|
||||
def do_snapshot(
|
||||
self, force: bool = False
|
||||
) -> Tuple[bool, Dict[str, MetaFile]]:
|
||||
"""Update snapshot meta information
|
||||
|
||||
Updates the snapshot meta information according to current targets
|
||||
|
|
@ -182,7 +184,9 @@ def snapshot(self, force: bool = False) -> Tuple[bool, Dict[str, MetaFile]]:
|
|||
|
||||
return update_version, removed
|
||||
|
||||
def timestamp(self, force: bool = False) -> Tuple[bool, Optional[MetaFile]]:
|
||||
def do_timestamp(
|
||||
self, force: bool = False
|
||||
) -> Tuple[bool, Optional[MetaFile]]:
|
||||
"""Update timestamp meta information
|
||||
|
||||
Updates timestamp according to current snapshot state
|
||||
|
|
|
|||
Loading…
Reference in a new issue