From eaa010c54bd448c75ae1aa0c967eef767b6a76e3 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Fri, 12 Jun 2015 14:09:21 +0200 Subject: [PATCH] suse/install: only install requested components Until now, the SUSE back-end has ignored requests for installation of specific components and always installed the base ceph and ceph-radosgw packages. This change maps component specific installation requests to SUSE package names using the previously added map_components() helper. Signed-off-by: David Disseldorp --- ceph_deploy/hosts/suse/install.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/ceph_deploy/hosts/suse/install.py b/ceph_deploy/hosts/suse/install.py index 34541bd..a42eb6d 100644 --- a/ceph_deploy/hosts/suse/install.py +++ b/ceph_deploy/hosts/suse/install.py @@ -23,16 +23,15 @@ def map_components(components): def install(distro, version_kind, version, adjust_repos, **kw): - # note: when split packages for ceph land for SUSE, - # `kw['components']` will have those. Unused for now. - packages = ['ceph', 'ceph-radosgw'] + packages = map_components(kw.get('components', [])) + pkg_managers.zypper_refresh(distro.conn) - pkg_managers.zypper(distro.conn, packages) + if len(packages): + pkg_managers.zypper(distro.conn, packages) def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw): - # note: when split packages for ceph land for SUSE, - # `kw['components']` will have those. Unused for now. + packages = map_components(kw.get('components', [])) repo_url = repo_url.strip('/') # Remove trailing slashes gpg_url_path = gpg_url.split('file://')[-1] # Remove file if present @@ -55,15 +54,14 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, **kw): ceph_repo_content) pkg_managers.zypper_refresh(distro.conn) - pkg_managers.zypper(distro.conn, 'ceph') + if len(packages): + pkg_managers.zypper(distro.conn, packages) def repo_install(distro, reponame, baseurl, gpgkey, **kw): # do we have specific components to install? # removed them from `kw` so that we don't mess with other defaults - # note: when split packages for ceph land for Suse, `packages` - # can be used. Unused for now. - packages = kw.pop('components', []) # noqa + packages = map_components(kw.pop('components', [])) # noqa # Get some defaults name = kw.get('name', '%s repo' % reponame) enabled = kw.get('enabled', 1) @@ -100,8 +98,5 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw): ) # Some custom repos do not need to install ceph - if install_ceph: - # Before any install, make sure we have `wget` - pkg_managers.zypper(distro.conn, 'wget') - - pkg_managers.zypper(distro.conn, 'ceph') + if install_ceph and len(packages): + pkg_managers.zypper(distro.conn, packages) -- 2.47.3