make logging not use f-str, change others to f-str (#22882)
This commit is contained in:
@@ -58,7 +58,7 @@ def process_tenant_plugin_autoupgrade_check_task(
|
||||
|
||||
click.echo(
|
||||
click.style(
|
||||
"Checking upgradable plugin for tenant: {}".format(tenant_id),
|
||||
f"Checking upgradable plugin for tenant: {tenant_id}",
|
||||
fg="green",
|
||||
)
|
||||
)
|
||||
@@ -68,7 +68,7 @@ def process_tenant_plugin_autoupgrade_check_task(
|
||||
|
||||
# get plugin_ids to check
|
||||
plugin_ids: list[tuple[str, str, str]] = [] # plugin_id, version, unique_identifier
|
||||
click.echo(click.style("Upgrade mode: {}".format(upgrade_mode), fg="green"))
|
||||
click.echo(click.style(f"Upgrade mode: {upgrade_mode}", fg="green"))
|
||||
|
||||
if upgrade_mode == TenantPluginAutoUpgradeStrategy.UpgradeMode.PARTIAL and include_plugins:
|
||||
all_plugins = manager.list_plugins(tenant_id)
|
||||
@@ -142,7 +142,7 @@ def process_tenant_plugin_autoupgrade_check_task(
|
||||
marketplace.record_install_plugin_event(new_unique_identifier)
|
||||
click.echo(
|
||||
click.style(
|
||||
"Upgrade plugin: {} -> {}".format(original_unique_identifier, new_unique_identifier),
|
||||
f"Upgrade plugin: {original_unique_identifier} -> {new_unique_identifier}",
|
||||
fg="green",
|
||||
)
|
||||
)
|
||||
@@ -156,11 +156,11 @@ def process_tenant_plugin_autoupgrade_check_task(
|
||||
},
|
||||
)
|
||||
except Exception as e:
|
||||
click.echo(click.style("Error when upgrading plugin: {}".format(e), fg="red"))
|
||||
click.echo(click.style(f"Error when upgrading plugin: {e}", fg="red"))
|
||||
traceback.print_exc()
|
||||
break
|
||||
|
||||
except Exception as e:
|
||||
click.echo(click.style("Error when checking upgradable plugin: {}".format(e), fg="red"))
|
||||
click.echo(click.style(f"Error when checking upgradable plugin: {e}", fg="red"))
|
||||
traceback.print_exc()
|
||||
return
|
||||
|
Reference in New Issue
Block a user