From: Zack Cerza Date: Wed, 26 Apr 2017 21:10:57 +0000 (-0600) Subject: qa/tasks/ceph: Remove /var/lib/ceph copypasta X-Git-Tag: v13.0.1~512^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4516ebb6c0e10c54968e0d3b2945881e0d709281;p=ceph-ci.git qa/tasks/ceph: Remove /var/lib/ceph copypasta Signed-off-by: Zack Cerza --- diff --git a/qa/tasks/ceph.py b/qa/tasks/ceph.py index 528be6e478d..19b0f40f799 100644 --- a/qa/tasks/ceph.py +++ b/qa/tasks/ceph.py @@ -26,6 +26,7 @@ import ceph_client as cclient from teuthology.orchestra.daemon import DaemonGroup CEPH_ROLE_TYPES = ['mon', 'mgr', 'osd', 'mds', 'rgw'] +DATA_PATH = '/var/lib/ceph/{type_}/{cluster}-{id_}' log = logging.getLogger(__name__) @@ -610,10 +611,8 @@ def cluster(ctx, config): for role in teuthology.cluster_roles_of_type(roles_for_host, 'mgr', cluster_name): _, _, id_ = teuthology.split_role(role) - mgr_dir = '/var/lib/ceph/mgr/{cluster}-{id}'.format( - cluster=cluster_name, - id=id_, - ) + mgr_dir = DATA_PATH.format( + type_='mgr', cluster=cluster_name, id_=id_) remote.run( args=[ 'sudo', @@ -639,10 +638,8 @@ def cluster(ctx, config): for role in teuthology.cluster_roles_of_type(roles_for_host, 'mds', cluster_name): _, _, id_ = teuthology.split_role(role) - mds_dir = '/var/lib/ceph/mds/{cluster}-{id}'.format( - cluster=cluster_name, - id=id_, - ) + mds_dir = DATA_PATH.format( + type_='mds', cluster=cluster_name, id_=id_) remote.run( args=[ 'sudo', @@ -686,8 +683,8 @@ def cluster(ctx, config): for role in teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name): _, _, id_ = teuthology.split_role(role) - mnt_point = '/var/lib/ceph/osd/{cluster}-{id}'.format( - cluster=cluster_name, id=id_) + mnt_point = DATA_PATH.format( + type_='osd', cluster=cluster_name, id_=id_) remote.run( args=[ 'sudo', @@ -791,8 +788,8 @@ def cluster(ctx, config): '--monmap', monmap_path, ], ) - mnt_point = '/var/lib/ceph/osd/{cluster}-{id}'.format( - cluster=cluster_name, id=id_) + mnt_point = DATA_PATH.format( + type_='osd', cluster=cluster_name, id_=id_) remote.run(args=[ 'sudo', 'chown', '-R', 'ceph:ceph', mnt_point ]) @@ -808,10 +805,10 @@ def cluster(ctx, config): _, _, id_ = teuthology.split_role(role) data = teuthology.get_file( remote=remote, - path='/var/lib/ceph/{type}/{cluster}-{id}/keyring'.format( - type=type_, - id=id_, - cluster=cluster_name, + path=os.path.join( + DATA_PATH.format( + type_=type_, id_=id_, cluster=cluster_name), + 'keyring', ), sudo=True, ) @@ -863,8 +860,8 @@ def cluster(ctx, config): for remote, roles_for_host in mons.remotes.iteritems(): for role in teuthology.cluster_roles_of_type(roles_for_host, 'mon', cluster_name): _, _, id_ = teuthology.split_role(role) - mnt_point = '/var/lib/ceph/mon/{cluster}-{id}'.format( - id=id_, cluster=cluster_name) + mnt_point = DATA_PATH.format( + type_='mon', id_=id_, cluster=cluster_name) remote.run( args=[ 'sudo', @@ -1006,8 +1003,8 @@ def cluster(ctx, config): is_mon = teuthology.is_type('mon', cluster_name) if is_mon(role): _, _, id_ = teuthology.split_role(role) - mon_dir = '/var/lib/ceph/mon/' + \ - '{0}-{1}'.format(cluster_name, id_) + mon_dir = DATA_PATH.format( + type_='mon', id_=id_, cluster=cluster_name) teuthology.pull_directory_tarball( remote, mon_dir,