import contextlib
import logging
import time
+import yaml
+import os
from cStringIO import StringIO
:param ctx: the argparse.Namespace object
:param config: the config dict
+
+ uses yaml defined in qa suite or in users
+ home dir to check for supported versions and
+ packages to install.
+
+ the format of yaml is:
+ versions:
+ supported:
+ - '1.3.0'
+ rpm:
+ mapped:
+ '1.3.0' : '0.94.1'
+ deb:
+ mapped:
+ '1.3.0' : '0.94.1'
+ pkgs:
+ rpm:
+ - ceph-mon
+ - ceph-osd
+ deb:
+ - ceph-osd
+ - ceph-mds
"""
+ yaml_path = None
+ # Look for rh specific packages in <suite_path>/rh/downstream.yaml
+ if 'suite_path' in ctx.config:
+ ds_yaml = os.path.join(
+ ctx.config['suite_path'],
+ 'rh',
+ 'downstream.yaml',
+ )
+ if os.path.exists(ds_yaml):
+ yaml_path = ds_yaml
+ # default to user home dir if one exists
+ default_yaml = os.path.expanduser('~/downstream.yaml')
+ if os.path.exists(default_yaml):
+ yaml_path = default_yaml
+ log.info("using yaml path %s", yaml_path)
+ downstream_config = yaml.safe_load(open(yaml_path))
+ rh_versions = downstream_config.get('versions', dict()).get('supported', [])
version = config['rhbuild']
- rh_versions = ['1.3.0', '1.3.1', '1.3.2', '2.0']
if version in rh_versions:
log.info("%s is a supported version", version)
else:
raise RuntimeError("Unsupported RH Ceph version %s", version)
-
with parallel() as p:
for remote in ctx.cluster.remotes.iterkeys():
if remote.os.name == 'rhel':
log.info("Installing on RHEL node: %s", remote.shortname)
- p.spawn(install_pkgs, ctx, remote, version)
+ p.spawn(rh_install_pkgs, ctx, remote, version, downstream_config)
else:
log.info("Node %s is not RHEL", remote.shortname)
raise RuntimeError("Test requires RHEL nodes")