mirror of
https://github.com/netinvent/npbackup.git
synced 2025-10-22 19:37:30 +08:00
expand units: Log missed bytes unit expansions
This commit is contained in:
parent
476fc636dd
commit
bd8e7e1925
1 changed files with 11 additions and 8 deletions
|
|
@ -402,6 +402,7 @@ def expand_units(object_config: dict, unexpand: bool = False) -> dict:
|
||||||
"upload_speed",
|
"upload_speed",
|
||||||
"download_speed",
|
"download_speed",
|
||||||
):
|
):
|
||||||
|
try:
|
||||||
if value:
|
if value:
|
||||||
if unexpand:
|
if unexpand:
|
||||||
return BytesConverter(value).human_iec_bytes
|
return BytesConverter(value).human_iec_bytes
|
||||||
|
|
@ -410,6 +411,8 @@ def expand_units(object_config: dict, unexpand: bool = False) -> dict:
|
||||||
if unexpand:
|
if unexpand:
|
||||||
return BytesConverter(0).human_iec_bytes
|
return BytesConverter(0).human_iec_bytes
|
||||||
return BytesConverter(0)
|
return BytesConverter(0)
|
||||||
|
except ValueError:
|
||||||
|
logger.warning(f"Cannot parse bytes value {key}:\"{value}\", keeping as is")
|
||||||
return value
|
return value
|
||||||
|
|
||||||
return replace_in_iterable(object_config, _expand_units, callable_wants_key=True)
|
return replace_in_iterable(object_config, _expand_units, callable_wants_key=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue