diff options
author | Josep Puigdemont <josep.puigdemont@enea.com> | 2015-12-09 13:40:19 +0100 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2015-12-11 12:14:32 -0500 |
commit | 2d260e08c1e1b4f115b226fdcaf02eb9e7dce77f (patch) | |
tree | ddce110fd984835924f46b12ad0cdba01268158f | |
parent | 464924c6e56227918f4a52f3214efe52e823be39 (diff) | |
download | meta-cloud-services-2d260e08c1e1b4f115b226fdcaf02eb9e7dce77f.tar.gz |
Use a bbclass to remove argparse from requirements
argparse is required by some of the CLI applications of openstack. The
module is provided by python 2.7, however python-distribute (used in
fido), is not able to find it:
Python 2.7.9 (default, Oct 27 2015, 18:12:55)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> pkg_resources.get_distribution('argparse')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/usr/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py",
line 338, in get_distribution
if isinstance(dist,Requirement): dist = get_provider(dist)
File
"/usr/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py",
line 217, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File
"/usr/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py",
line 698, in require
needed = self.resolve(parse_requirements(requirements))
File
"/usr/lib/python2.7/site-packages/distribute-0.6.49-py2.7.egg/pkg_resources.py",
line 596, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: argparse
>>> import argparse
>>>
This patch adds a class that when inherited will remove argparse from
requirements.txt. Also with this patch, those python modules used by
openstackclient inherit the class.
Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
6 files changed, 8 insertions, 5 deletions
diff --git a/meta-openstack/classes/rmargparse.bbclass b/meta-openstack/classes/rmargparse.bbclass new file mode 100644 index 0000000..65d8459 --- /dev/null +++ b/meta-openstack/classes/rmargparse.bbclass | |||
@@ -0,0 +1,3 @@ | |||
1 | do_install_append() { | ||
2 | sed -i '/argparse/d' ${D}${libdir}/python2.7/site-packages/*/requires.txt | ||
3 | } | ||
diff --git a/meta-openstack/recipes-devtools/python/python-cinderclient_git.bb b/meta-openstack/recipes-devtools/python/python-cinderclient_git.bb index 31875fa..7e8e780 100644 --- a/meta-openstack/recipes-devtools/python/python-cinderclient_git.bb +++ b/meta-openstack/recipes-devtools/python/python-cinderclient_git.bb | |||
@@ -18,7 +18,7 @@ PV="1.1.1+git${SRCPV}" | |||
18 | SRCREV="9e94d814c6ae07c3d5e8242754aebcce150265cc" | 18 | SRCREV="9e94d814c6ae07c3d5e8242754aebcce150265cc" |
19 | S = "${WORKDIR}/git" | 19 | S = "${WORKDIR}/git" |
20 | 20 | ||
21 | inherit setuptools monitor | 21 | inherit setuptools monitor rmargparse |
22 | 22 | ||
23 | DEPENDS += " \ | 23 | DEPENDS += " \ |
24 | python-pip \ | 24 | python-pip \ |
diff --git a/meta-openstack/recipes-devtools/python/python-glanceclient_git.bb b/meta-openstack/recipes-devtools/python/python-glanceclient_git.bb index d5da78f..ab32be8 100644 --- a/meta-openstack/recipes-devtools/python/python-glanceclient_git.bb +++ b/meta-openstack/recipes-devtools/python/python-glanceclient_git.bb | |||
@@ -21,7 +21,7 @@ SRC_URI = "\ | |||
21 | 21 | ||
22 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
23 | 23 | ||
24 | inherit setuptools monitor | 24 | inherit setuptools monitor rmargparse |
25 | 25 | ||
26 | FILES_${PN} += "${datadir}/${SRCNAME}" | 26 | FILES_${PN} += "${datadir}/${SRCNAME}" |
27 | 27 | ||
diff --git a/meta-openstack/recipes-devtools/python/python-keystoneclient_git.bb b/meta-openstack/recipes-devtools/python/python-keystoneclient_git.bb index 59c65e9..f4810e5 100644 --- a/meta-openstack/recipes-devtools/python/python-keystoneclient_git.bb +++ b/meta-openstack/recipes-devtools/python/python-keystoneclient_git.bb | |||
@@ -17,7 +17,7 @@ PV = "1.6.0+git${SRCPV}" | |||
17 | SRCREV = "f6ab133f25f00e041cd84aa8bbfb422594d1942f" | 17 | SRCREV = "f6ab133f25f00e041cd84aa8bbfb422594d1942f" |
18 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
19 | 19 | ||
20 | inherit setuptools monitor | 20 | inherit setuptools monitor rmargparse |
21 | 21 | ||
22 | FILES_${PN}-doc += "${datadir}/keystoneclient" | 22 | FILES_${PN}-doc += "${datadir}/keystoneclient" |
23 | 23 | ||
diff --git a/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb b/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb index e35be5d..16a2e92 100644 --- a/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb +++ b/meta-openstack/recipes-devtools/python/python-neutronclient_git.bb | |||
@@ -29,7 +29,7 @@ PV = "2.4.0+git${SRCPV}" | |||
29 | SRCREV = "aa1215a5ad063b299d32ef319eb63d5210249a9b" | 29 | SRCREV = "aa1215a5ad063b299d32ef319eb63d5210249a9b" |
30 | S = "${WORKDIR}/git" | 30 | S = "${WORKDIR}/git" |
31 | 31 | ||
32 | inherit setuptools monitor | 32 | inherit setuptools monitor rmargparse |
33 | 33 | ||
34 | PACKAGECONFIG ?= "bash-completion" | 34 | PACKAGECONFIG ?= "bash-completion" |
35 | PACKAGECONFIG[bash-completion] = ",,bash-completion,bash-completion ${BPN}-bash-completion" | 35 | PACKAGECONFIG[bash-completion] = ",,bash-completion,bash-completion ${BPN}-bash-completion" |
diff --git a/meta-openstack/recipes-devtools/python/python-novaclient_git.bb b/meta-openstack/recipes-devtools/python/python-novaclient_git.bb index 1454a7c..d8d7168 100644 --- a/meta-openstack/recipes-devtools/python/python-novaclient_git.bb +++ b/meta-openstack/recipes-devtools/python/python-novaclient_git.bb | |||
@@ -15,7 +15,7 @@ PV = "2.23.0+git${SRCPV}" | |||
15 | SRCREV = "e0f5072907a00d48a183dd8fc91a6cf6038ca279" | 15 | SRCREV = "e0f5072907a00d48a183dd8fc91a6cf6038ca279" |
16 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
17 | 17 | ||
18 | inherit setuptools monitor | 18 | inherit setuptools monitor rmargparse |
19 | 19 | ||
20 | DEPENDS = "python-setuptools-git" | 20 | DEPENDS = "python-setuptools-git" |
21 | DEPENDS += " \ | 21 | DEPENDS += " \ |