Include logic taken from d2to1 to allow us to inject into setup.py. Combined
with ols openstack/common/setup.py code.
Change-Id: I27b341403bb8245e38f8e3c386f1a835b90b1843
quantum run_tests.py fails because
openstack.common.setup._get_version_from_git fails. It is because
quantum unit tests run under quantum/tests/unit instead of git root dir.
So the function should check parent dirs for .git.
cinder folks seem to have hit this bug (1125416).
ERROR: test_network_gateway_update (quantum.tests.unit.nicira.test_networkgw.NetworkGatewayExtensionTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "quantum/quantum/tests/unit/nicira/test_networkgw.py", line 70, in setUp
config.parse(args=args)
File "quantum/quantum/common/config.py", line 99, in parse
version='%%prog %s' % quantum_version.release_string())
File "quantum/quantum/openstack/common/version.py", line 63, in release_string
self.release = self._get_version_from_pkg_resources()
File "quantum/quantum/openstack/common/version.py", line 56, in _get_version_from_pkg_resources
return setup.get_version(self.package)
File "quantum/quantum/openstack/common/setup.py", line 334, in get_version
raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository.
Change-Id: I2e24c00b5ba8f35381cac081ff72d86ea0d75d19
Fixes: bug #1131162 and bug #1125416
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
In common setup the check for the .git directory is too
restrictive. Instead of checking that it is a directory just
check to see if it exists. That way if the project is part
of a submodule it will continue to work correctly.
Change-Id: If6b6531ab5778ac17537e3f18bde1844620c8316
Fixes: bug 1126416
Found when testing a bug in cinder (1125416), code
relying on throw_on_error won't work because returncode
is None if checked before the communicate() method is
called
Change-Id: I8c9dd00396346ec3ad7bbe1dc17643c385da8d6f
It was pointed out that we missed the use-case that running tests
in a fresh tree checkout should work - and we missed that by
reaching too far into the setup module interface. Shame on us.
Change-Id: Ic0056a3113b308f063d927484e1e4a44c9316a2d
We currently use 'git describe --always' to figure out the number of
commits there have been leading up to the HEAD commit.
However, if there are no tags in the repo, git-describe just returns
the sha hash of HEAD and we fail.
In that case, use 'git rev-list HEAD | wc -l' so we can be #winning.
Change-Id: I345e0ee32189504276b3dfd3367057ce1d4a2b06