Skip to contentSkip to conversation

metadata.py: return info after fallback methods

PATCH New Chen Qi 1 participant 2 messages Mar 7, 2019

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

cover metadata.py: return info after fallback methods

*** BLURB HERE ***
The following changes since commit 525c5e516323ff584f65bed3320626b1d056260d:

README.poky: Add pointers to key contributions wiki guides (2019-03-06 23:12:27 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib ChenQi/return-info
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/return-info

Chen Qi (1):
metadata.py: return info after fallback methods

 meta/lib/oeqa/utils/metadata.py | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 1/1 metadata.py: return info after fallback methods

If python3 git module is not installed, we fall back to some git command to get info. A previous commit (b8d22ed6) accidently deleted the return statement, causing errors like below.

Exception: UnboundLocalError: local variable 'InvalidGitRepositoryError' referenced before assignment

---
 meta/lib/oeqa/utils/metadata.py | 1 +
 1 file changed, 1 insertion(+)
meta/lib/oeqa/utils/metadata.py +1 -0
index 70a2756..e0808ae 100644
@@ -76,6 +76,7 @@ def git_rev_info(path):
             info['commit_count'] = int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"], cwd=path).decode('utf-8').strip())
         except subprocess.CalledProcessError:
             pass
+        return info
     try:
         repo = Repo(path, search_parent_directories=True)
     except (InvalidGitRepositoryError, NoSuchPathError):
Signature · 1 line
1.9.1