From patchwork Mon Jan 25 15:40:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 75059 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0PFeE7f028903 for ; Mon, 25 Jan 2010 15:40:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753097Ab0AYPkL (ORCPT ); Mon, 25 Jan 2010 10:40:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752699Ab0AYPkL (ORCPT ); Mon, 25 Jan 2010 10:40:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1817 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248Ab0AYPkK (ORCPT ); Mon, 25 Jan 2010 10:40:10 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0PFe84H010119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 Jan 2010 10:40:09 -0500 Received: from localhost.localdomain (vpn-10-234.rdu.redhat.com [10.11.10.234]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0PFe6DR029391; Mon, 25 Jan 2010 10:40:07 -0500 From: Lucas Meneghel Rodrigues To: kvm@vger.kernel.org Cc: autotest@test.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH] KVM Test: Utils - Handle git commit without tags Date: Mon, 25 Jan 2010 13:40:04 -0200 Message-Id: <1264434004-8958-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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