Fix how we are missing the extra pips.

Change-Id: Iaabe6a57634d7ca6c3ebae7b78afccd64fb72b9d
This commit is contained in:
Joshua Harlow
2013-06-19 13:16:29 -07:00
parent dea722db31
commit 72c87f7b62
3 changed files with 40 additions and 11 deletions

View File

@@ -125,16 +125,19 @@ class DependencyHandler(object):
def package_start(self):
requires_files = []
extra_pips = []
for inst in self.instances:
for i in self.instances:
try:
requires_files.extend(inst.requires_files)
requires_files.extend(i.requires_files)
except AttributeError:
pass
for pkg in inst.get_option("pips") or []:
extra_pips.append(
"%s%s" % (pkg["name"], pkg.get("version", "")))
# Ensure we include any extra pips that are desired.
i_extra_pips = i.get_option("pips") or []
for i_pip in i_extra_pips:
extra_req = pip_helper.create_requirement(i_pip['name'],
i_pip.get('version'))
extra_pips.append(str(extra_req))
requires_files = filter(sh.isfile, requires_files)
self.gather_pips_to_install(requires_files, extra_pips)
self.gather_pips_to_install(requires_files, sorted(set(extra_pips)))
self.clean_pip_requires(requires_files)
def package_instance(self, instance):

View File

@@ -274,11 +274,20 @@ class YumDependencyHandler(base.DependencyHandler):
quiet=True)
p_bar.update(i + 1)
def _write_spec_file(self, app_dir, rpm_name, template_name, params):
def _write_spec_file(self, instance, app_dir, rpm_name, template_name,
params):
requires_what = []
if sh.isfile(sh.joinpths(app_dir, "setup.py")):
egg_info = pip_helper.get_directory_details(app_dir)
requires_what = egg_info['dependencies']
requires_what.extend(egg_info['dependencies'])
# Ensure we include any extra pips that are desired.
extra_pips = instance.get_option('pips') or []
for i_pip in extra_pips:
extra_req = pip_helper.create_requirement(i_pip['name'],
i_pip.get('version'))
extra_req = str(extra_req)
if extra_req not in requires_what:
requires_what.append(extra_req)
params['requires'] = self._convert_names_python2rpm(requires_what)
params["epoch"] = self.OPENSTACK_EPOCH
content = utils.load_template(self.SPEC_TEMPLATE_DIR, template_name)[1]
@@ -330,7 +339,7 @@ class YumDependencyHandler(base.DependencyHandler):
]
sh.execute_save_output(cmdline,
sh.joinpths(self.log_dir,
sh.basename(spec_filename)),
sh.basename(spec_filename)),
quiet=True)
def _write_git_tarball(self, pkg_dir, spec_filename):
@@ -416,7 +425,7 @@ class YumDependencyHandler(base.DependencyHandler):
rpm_name = None
if rpm_name:
template_name = template_name or "%s.spec" % rpm_name
spec_filename = self._write_spec_file(app_dir, rpm_name,
spec_filename = self._write_spec_file(instance, app_dir, rpm_name,
template_name, params)
self._build_from_spec(instance, spec_filename)
else:

View File

@@ -67,7 +67,10 @@ components:
coverage: anvil.components.base_testing:PythonTestingComponent
uninstall: anvil.components.base_install:PkgUninstallComponent
pips:
- name: hp3parclient
- name: hp3parclient
# Need to ensure we pull in the mysql bindings since that what
# our recommended database configuration is.
- name: MySQL-python
daemon_to_package:
all: openstack-cinder
volume: openstack-cinder
@@ -157,6 +160,9 @@ components:
# then ignores warlock's requirement
- name: jsonschema
version: ">=0.7,<2"
# Need to ensure we pull in the mysql bindings since that what
# our recommended database configuration is.
- name: MySQL-python
daemon_to_package:
api: openstack-glance
registry: openstack-glance
@@ -192,6 +198,10 @@ components:
uninstall: anvil.components.keystone:KeystoneUninstaller
daemon_to_package:
all: openstack-keystone
pips:
# Need to ensure we pull in the mysql bindings since that what
# our recommended database configuration is.
- name: MySQL-python
keystone-client:
action_classes:
install: anvil.components.base_install:PythonInstallComponent
@@ -213,6 +223,9 @@ components:
# installed in rhel uses a old version of crypto which
# other components actually can't use. This sucks...
- name: paramiko
# Need to ensure we pull in the mysql bindings since that what
# our recommended database configuration is.
- name: MySQL-python
daemon_to_package:
api: openstack-nova-api
conductor: openstack-nova-conductor
@@ -273,6 +286,10 @@ components:
l3-agent: openstack-quantum
rpc-zmq-receiver: openstack-quantum
server: openstack-quantum
pips:
# Need to ensure we pull in the mysql bindings since that what
# our recommended database configuration is.
- name: MySQL-python
quantum-client:
action_classes:
install: anvil.components.base_install:PythonInstallComponent