]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
[RM-18169] centos/install: accommodate installation from shaman to chacra repos
authorAlfredo Deza <adeza@redhat.com>
Thu, 8 Dec 2016 15:14:29 +0000 (10:14 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 8 Dec 2016 15:34:40 +0000 (10:34 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ceph_deploy/hosts/centos/install.py

index d7c6812ed445288e50d28ff36e1e801bda838522..c95d746faf20ecee4c2f23fba2619f923c3ebd8b 100644 (file)
@@ -1,9 +1,12 @@
+import logging
 from ceph_deploy.util import templates
 from ceph_deploy.lib import remoto
 from ceph_deploy.hosts.common import map_components
 from ceph_deploy.util.paths import gpg
+from ceph_deploy.util import net
 
 
+LOG = logging.getLogger(__name__)
 NON_SPLIT_PACKAGES = ['ceph-osd', 'ceph-mon', 'ceph-mds']
 
 
@@ -46,7 +49,6 @@ def install(distro, version_kind, version, adjust_repos, **kw):
 
     gpgcheck = kw.pop('gpgcheck', 1)
     logger = distro.conn.logger
-    release = distro.release
     machine = distro.machine_type
     repo_part = repository_url_part(distro)
     dist = rpm_dist(distro)
@@ -89,17 +91,23 @@ def install(distro, version_kind, version, adjust_repos, **kw):
         elif version_kind in ['dev', 'dev_commit']:
             logger.info('skipping install of ceph-release package')
             logger.info('repo file will be created manually')
+            shaman_url = 'https://shaman.ceph.com/api/repos/ceph/{version}/{sha1}/{distro}/{distro_version}/repo/?arch={arch}'.format(
+                distro=distro.normalized_name,
+                distro_version=distro.normalized_release.major,
+                version=kw['args'].dev,
+                sha1=kw['args'].dev_commit or 'latest',
+                arch=machine
+                )
+            LOG.debug('fetching repo information from: %s' % shaman_url)
+            content = net.get_chacra_repo(shaman_url)
             mirror_install(
                 distro,
-                'http://gitbuilder.ceph.com/ceph-rpm-centos{release}-{machine}-basic/{sub}/{version}/'.format(
-                    release=release.split(".", 1)[0],
-                    machine=machine,
-                    sub='ref' if version_kind == 'dev' else 'sha1',
-                    version=version),
-                gpg.url(key),
+                '',  # empty repo_url
+                None,  # no need to use gpg here, repos are unsigned
                 adjust_repos=True,
                 extra_installs=False,
                 gpgcheck=gpgcheck,
+                repo_content=content
             )
 
         else:
@@ -125,15 +133,17 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos, extra_installs=True,
     distro.packager.clean()
 
     if adjust_repos:
-        distro.packager.add_repo_gpg_key(gpg_url)
+        if gpg_url:
+            distro.packager.add_repo_gpg_key(gpg_url)
 
         ceph_repo_content = templates.ceph_repo.format(
             repo_url=repo_url,
             gpg_url=gpg_url,
             gpgcheck=gpgcheck,
         )
+        content = kw.get('repo_content', ceph_repo_content)
 
-        distro.conn.remote_module.write_yum_repo(ceph_repo_content)
+        distro.conn.remote_module.write_yum_repo(content)
         # set the right priority
         if distro.packager.name == 'yum':
             distro.packager.install('yum-plugin-priorities')