Skip to content

Commit

Permalink
fix: fix yk and GitError imports, run updater without ykman
Browse files Browse the repository at this point in the history
  • Loading branch information
renatav committed Jan 10, 2024
1 parent 5915f3e commit 312598f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion taf/api/utils/_roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from tuf.repository_tool import Repository as TUFRepository, Targets
from taf.exceptions import TAFError
from taf.models.types import RolesIterator
from taf.yubikey import get_key_serial_by_id
from tuf.repository_tool import Metadata
from taf.keys import get_key_name
from taf.auth_repo import AuthenticationRepository
Expand All @@ -18,6 +17,10 @@
from taf.models.types import Role
from taf.log import taf_logger

try:
from taf.yubikey import get_key_serial_by_id
except ImportError:
pass

@log_on_start(INFO, "Creating delegations", logger=taf_logger)
@log_on_end(DEBUG, "Finished creating delegations", logger=taf_logger)
Expand Down
2 changes: 1 addition & 1 deletion taf/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from taf.models.models import TAFKey
from taf.models.types import TargetsRole, MainRoles, UserKeyData
from taf.repository_tool import Repository
from taf.yubikey import get_key_serial_by_id
from tuf.repository_tool import (
generate_and_write_unencrypted_rsa_keypair,
generate_and_write_rsa_keypair,
Expand All @@ -32,6 +31,7 @@

try:
import taf.yubikey as yk
from taf.yubikey import get_key_serial_by_id
from taf.yubikey import export_yk_certificate
except ImportError:
taf_logger.warning(
Expand Down
2 changes: 1 addition & 1 deletion taf/updater/updater_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tempfile
from typing import Any, Dict, List, Optional
from attr import attrs, define, field
from git import GitError
from taf.git import GitError
from logdecorator import log_on_end, log_on_start
from taf.git import GitRepository

Expand Down

0 comments on commit 312598f

Please sign in to comment.