Skip to content

Commit 3ce3ab0

Browse files
committed
Catch git describe failure
In some situations the file system may not allow the git describe --always to cross file system boundaries fatal: Not a git repository (or any parent up to mount point /tmp) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set) Ignore the failure and just log that we tried. Signed-off-by: Deb McLemore <[email protected]>
1 parent 675d88f commit 3ce3ab0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

OpTestConfiguration.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,13 @@ def parse_args(self, argv=None):
511511
OpTestLogger.optest_logger_glob.optest_logger.debug(
512512
"conf file defaults={}".format(defaults))
513513
cmd = "git describe --always"
514-
git_output = subprocess.check_output(cmd.split())
515-
# log for triage of how dated the repo is
516-
OpTestLogger.optest_logger_glob.optest_logger.debug(
517-
"op-test-framework git level = {}".format(git_output))
514+
try:
515+
git_output = subprocess.check_output(cmd.split())
516+
# log for triage of how dated the repo is
517+
OpTestLogger.optest_logger_glob.optest_logger.debug(
518+
"op-test-framework git level = {}".format(git_output))
519+
except Exception as e:
520+
OpTestLogger.optest_logger_glob.optest_logger.debug("Unable to get git describe")
518521
# setup AES and Hostlocker configs after the logging is setup
519522
locker_timeout = time.time() + 60*self.args.locker_wait
520523
locker_code = errno.ETIME # 62

0 commit comments

Comments
 (0)