Skip to content

Commit 1bf9c66

Browse files
committed
Refine exceptions handled while reading data from COMMIT and VERSION
Signed-off-by: Tobias Wolf <[email protected]>
1 parent cc2b44a commit 1bf9c66

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/gardenlinux/features/__main__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import argparse
9+
import logging
910
import os
1011
import re
1112
import sys
@@ -81,7 +82,13 @@ def main() -> None:
8182
try:
8283
version_data = get_version_and_commit_id_from_files(gardenlinux_root)
8384
version = f"{version_data[0]}-{version_data[1]}"
84-
except:
85+
except RuntimeError as exc:
86+
logging.debug(
87+
"Failed to parse version information for GL root '{0}': {1}".format(
88+
gardenlinux_root, exc
89+
)
90+
)
91+
8592
version = args.default_version
8693

8794
if args.cname:

src/gardenlinux/features/cname_main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from functools import reduce
99
from os.path import basename, dirname
1010
import argparse
11+
import logging
1112
import re
1213

1314
from .cname import CName
@@ -55,8 +56,12 @@ def main():
5556
try:
5657
version_data = get_version_and_commit_id_from_files(gardenlinux_root)
5758
version = f"{version_data[0]}-{version_data[1]}"
58-
except:
59-
pass
59+
except RuntimeError as exc:
60+
logging.warning(
61+
"Failed to parse version information for GL root '{0}': {1}".format(
62+
gardenlinux_root, exc
63+
)
64+
)
6065

6166
cname = CName(args.cname, arch=arch, version=version)
6267

0 commit comments

Comments
 (0)