mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
No need to log relative paths
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
8c126b8422
commit
2a5f76f38f
2 changed files with 9 additions and 15 deletions
|
@ -214,7 +214,7 @@ def debian(
|
|||
ftp_archive_config_file.write_text(textwrap.dedent(ftp_archive_config))
|
||||
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, repo_path, create_repo_path)
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
|
||||
pool_path = create_repo_path / "pool"
|
||||
pool_path.mkdir(exist_ok=True)
|
||||
|
@ -417,7 +417,7 @@ def rpm(
|
|||
)
|
||||
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, repo_path, create_repo_path)
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
|
||||
for fpath in incoming.iterdir():
|
||||
if ".src" in fpath.suffixes:
|
||||
|
@ -792,7 +792,7 @@ def src(
|
|||
tools.utils.gpg_sign(ctx, key_id, fpath)
|
||||
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, repo_path, create_repo_path)
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
ctx.info("Done")
|
||||
|
||||
|
||||
|
@ -1209,7 +1209,7 @@ def _create_onedir_based_repo(
|
|||
tools.utils.gpg_sign(ctx, key_id, fpath)
|
||||
|
||||
# Export the GPG key in use
|
||||
tools.utils.export_gpg_key(ctx, key_id, repo_path, create_repo_path)
|
||||
tools.utils.export_gpg_key(ctx, key_id, create_repo_path)
|
||||
|
||||
repo_json = _get_repo_json_file_contents(
|
||||
ctx, bucket_name=bucket_name, repo_path=repo_path, repo_json_path=repo_json_path
|
||||
|
|
|
@ -51,22 +51,16 @@ def create_progress_bar(file_progress: bool = False, **kwargs):
|
|||
)
|
||||
|
||||
|
||||
def export_gpg_key(
|
||||
ctx: Context, key_id: str, repo_path: pathlib.Path, create_repo_path: pathlib.Path
|
||||
):
|
||||
keyfile_gpg = create_repo_path.joinpath(GPG_KEY_FILENAME).with_suffix(".gpg")
|
||||
def export_gpg_key(ctx: Context, key_id: str, export_path: pathlib.Path):
|
||||
keyfile_gpg = export_path.joinpath(GPG_KEY_FILENAME).with_suffix(".gpg")
|
||||
if keyfile_gpg.exists():
|
||||
keyfile_gpg.unlink()
|
||||
ctx.info(
|
||||
f"Exporting GnuPG Key '{key_id}' to {keyfile_gpg.relative_to(repo_path)} ..."
|
||||
)
|
||||
ctx.info(f"Exporting GnuPG Key '{key_id}' to {keyfile_gpg} ...")
|
||||
ctx.run("gpg", "--output", str(keyfile_gpg), "--export", key_id)
|
||||
keyfile_pub = create_repo_path.joinpath(GPG_KEY_FILENAME).with_suffix(".pub")
|
||||
keyfile_pub = export_path.joinpath(GPG_KEY_FILENAME).with_suffix(".pub")
|
||||
if keyfile_pub.exists():
|
||||
keyfile_pub.unlink()
|
||||
ctx.info(
|
||||
f"Exporting GnuPG Key '{key_id}' to {keyfile_pub.relative_to(repo_path)} ..."
|
||||
)
|
||||
ctx.info(f"Exporting GnuPG Key '{key_id}' to {keyfile_pub} ...")
|
||||
ctx.run("gpg", "--armor", "--output", str(keyfile_pub), "--export", key_id)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue