diff mbox

KVM Test: Utils - Handle git commit without tags

Message ID 1264434004-8958-1-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues Jan. 25, 2010, 3:40 p.m. UTC
None
diff mbox

Patch

diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py
index df26a77..a6da832 100644
--- a/client/tests/kvm/kvm_utils.py
+++ b/client/tests/kvm/kvm_utils.py
@@ -358,7 +358,11 @@  def get_git_branch(repository, branch, srcdir, commit=None, lbranch=None):
         utils.system("git checkout %s" % commit)
 
     h = utils.system_output('git log --pretty=format:"%H" -1')
-    desc = utils.system_output("git describe")
+    try:
+        desc = "tag %s" % utils.system_output("git describe")
+    except CmdError:
+        desc = "no tag found"
+
     logging.info("Commit hash for %s is %s (%s)" % (repository, h.strip(),
                                                     desc))
     return srcdir