]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
adapt remoto imports for new optional vendoring
authorAlfredo Deza <alfredo.deza@inktank.com>
Fri, 27 Jun 2014 13:16:16 +0000 (09:16 -0400)
committerAlfredo Deza <alfredo.deza@inktank.com>
Fri, 27 Jun 2014 13:16:16 +0000 (09:16 -0400)
Signed-off-by: Alfredo Deza <alfredo.deza@inktank.com>
14 files changed:
ceph_deploy/hosts/centos/install.py
ceph_deploy/hosts/centos/mon/create.py
ceph_deploy/hosts/common.py
ceph_deploy/hosts/debian/install.py
ceph_deploy/hosts/debian/mon/create.py
ceph_deploy/hosts/debian/uninstall.py
ceph_deploy/hosts/fedora/install.py
ceph_deploy/hosts/fedora/mon/create.py
ceph_deploy/hosts/suse/install.py
ceph_deploy/hosts/suse/mon/create.py
ceph_deploy/hosts/suse/uninstall.py
ceph_deploy/tests/unit/util/test_pkg_managers.py
ceph_deploy/util/pkg_managers.py
ceph_deploy/util/ssh.py

index d6f605e272412900c42a62d47a20d41430719150..f66c91ecc39c9c778eed2d2df008cf0623e708a0 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.util import pkg_managers, templates
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def repository_url_part(distro):
@@ -44,7 +44,7 @@ def install(distro, version_kind, version, adjust_repos):
         key = 'autobuild'
 
     if adjust_repos:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -67,7 +67,7 @@ def install(distro, version_kind, version, adjust_repos):
                 version=version,
                 )
 
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -82,7 +82,7 @@ def install(distro, version_kind, version, adjust_repos):
         distro.conn.remote_module.set_repo_priority(['Ceph', 'Ceph-noarch', 'ceph-source'])
         logger.warning('altered ceph.repo priorities to contain: priority=1')
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'yum',
@@ -101,7 +101,7 @@ def install_epel(distro):
     if distro.name.lower() in ['centos', 'scientific']:
         distro.conn.logger.info('adding EPEL repository')
         if float(distro.release) >= 6:
-            process.run(
+            remoto.process.run(
                 distro.conn,
                 ['wget', 'http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm'],
             )
@@ -113,7 +113,7 @@ def install_epel(distro):
                 ],
             )
         else:
-            process.run(
+            remoto.process.run(
                 distro.conn,
                 ['wget', 'http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm'],
             )
@@ -161,7 +161,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos):
     pkg_managers.yum_clean(distro.conn)
 
     if adjust_repos:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -196,7 +196,7 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw):
     pkg_managers.yum_clean(distro.conn)
 
     if gpgkey:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
index 16b9f223ffcd083f120a6f3db366e42495b59a6d..d0dddbd6b6395ee45eba33d5e65dc42699993949 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.hosts import common
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def create(distro, args, monitor_keyring):
@@ -7,7 +7,7 @@ def create(distro, args, monitor_keyring):
     common.mon_create(distro, args, monitor_keyring, hostname)
     service = distro.conn.remote_module.which_service()
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             service,
index 96391986ca3748bc8b31f444f4a95c03385a9e17..b71db9daa4f8412d80768902f853de16a49c5699 100644 (file)
@@ -1,6 +1,6 @@
 from ceph_deploy.util import paths
 from ceph_deploy import conf
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 from StringIO import StringIO
 
 
@@ -8,7 +8,7 @@ def ceph_version(conn):
     """
     Log the remote ceph-version by calling `ceph --version`
     """
-    return process.run(conn, ['ceph', '--version'])
+    return remoto.process.run(conn, ['ceph', '--version'])
 
 
 def mon_create(distro, args, monitor_keyring, hostname):
@@ -46,7 +46,7 @@ def mon_create(distro, args, monitor_keyring, hostname):
             monitor_keyring,
         )
 
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'ceph-mon',
@@ -104,7 +104,7 @@ def mon_add(distro, args, monitor_keyring):
         )
 
         # get the monmap
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'ceph',
@@ -116,7 +116,7 @@ def mon_add(distro, args, monitor_keyring):
         )
 
         # now use it to prepare the monitor's data dir
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'ceph-mon',
@@ -130,7 +130,7 @@ def mon_add(distro, args, monitor_keyring):
         )
 
         # add it
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'ceph',
@@ -151,7 +151,7 @@ def mon_add(distro, args, monitor_keyring):
     distro.conn.remote_module.create_init_path(init_path)
 
     # start the mon using the address
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'ceph-mon',
index f8d1b9b3baebc6b49ef9bdb4e209d264470438ff..6263689a42c57628888b4d68ea406e1aaeef642e 100644 (file)
@@ -1,4 +1,4 @@
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 from ceph_deploy.util import pkg_managers
 
 
@@ -12,7 +12,7 @@ def install(distro, version_kind, version, adjust_repos):
         key = 'autobuild'
 
     # Make sure ca-certificates is installed
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'env',
@@ -26,7 +26,7 @@ def install(distro, version_kind, version, adjust_repos):
     )
 
     if adjust_repos:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'wget',
@@ -37,7 +37,7 @@ def install(distro, version_kind, version, adjust_repos):
             stop_on_nonzero=False,
         )
 
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'apt-key',
@@ -63,13 +63,13 @@ def install(distro, version_kind, version, adjust_repos):
 
         distro.conn.remote_module.write_sources_list(url, codename)
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         ['apt-get', '-q', 'update'],
         )
 
     # TODO this does not downgrade -- should it?
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'env',
@@ -99,7 +99,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos):
 
     if adjust_repos:
         if not gpg_url.startswith('file://'):
-            process.run(
+            remoto.process.run(
                 distro.conn,
                 [
                     'wget',
@@ -111,7 +111,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos):
             )
 
         gpg_file = 'release.asc' if not gpg_url.startswith('file://') else gpg_path
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'apt-key',
@@ -145,7 +145,7 @@ def repo_install(distro, repo_name, baseurl, gpgkey, **kw):
     baseurl = baseurl.strip('/')  # Remove trailing slashes
 
     if gpgkey:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'wget',
@@ -156,7 +156,7 @@ def repo_install(distro, repo_name, baseurl, gpgkey, **kw):
             stop_on_nonzero=False,
         )
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'apt-key',
index 29fa49ceb018a7dbe75d76669a43e8f67ffb93d5..93d4393d4f6f17d402201e23dc0ff68efba7aecb 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.hosts import common
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def create(distro, args, monitor_keyring):
@@ -12,7 +12,7 @@ def create(distro, args, monitor_keyring):
         logger.warning('could not find `service` executable')
 
     if distro.init == 'upstart':  # Ubuntu uses upstart
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'initctl',
@@ -26,7 +26,7 @@ def create(distro, args, monitor_keyring):
 
     elif distro.init == 'sysvinit':  # Debian uses sysvinit
 
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 service,
index 8ffdca18bf4729db1fff1f15d674940b137b0479..f091628aaffe96230ebd2400bae671aa2793d87a 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.util import pkg_managers
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def uninstall(conn, purge=False):
index f7926f643295586858a511172bdaaef300f5508f..7ce50353c695f13c2956ebce0326bf89fa00f424 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.util import pkg_managers, templates
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 from ceph_deploy.hosts.centos.install import repo_install, mirror_install  # noqa
 
 
@@ -14,7 +14,7 @@ def install(distro, version_kind, version, adjust_repos):
         key = 'autobuild'
 
     if adjust_repos:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -39,7 +39,7 @@ def install(distro, version_kind, version, adjust_repos):
                 version=version,
                 )
 
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -60,7 +60,7 @@ def install(distro, version_kind, version, adjust_repos):
         logger.warning('altered ceph.repo priorities to contain: priority=1')
 
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'yum',
index 16b9f223ffcd083f120a6f3db366e42495b59a6d..d0dddbd6b6395ee45eba33d5e65dc42699993949 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.hosts import common
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def create(distro, args, monitor_keyring):
@@ -7,7 +7,7 @@ def create(distro, args, monitor_keyring):
     common.mon_create(distro, args, monitor_keyring, hostname)
     service = distro.conn.remote_module.which_service()
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             service,
index 030a5e1d226e71f36f11832f8ad588299886c185..d4f27df959b63e87bea7673f40e988f825289998 100644 (file)
@@ -1,5 +1,5 @@
 from ceph_deploy.util import templates, pkg_managers
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 import logging
 LOG = logging.getLogger(__name__)
 
@@ -32,7 +32,7 @@ def install(distro, version_kind, version, adjust_repos):
         protocol = "https"
         if distro_name == 'sles11':
             protocol = "http"
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -58,7 +58,7 @@ def install(distro, version_kind, version, adjust_repos):
                 version=version,
                 )
 
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -72,7 +72,7 @@ def install(distro, version_kind, version, adjust_repos):
                 ]
             )
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'zypper',
@@ -89,7 +89,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos):
     gpg_url_path = gpg_url.split('file://')[-1]  # Remove file if present
 
     if adjust_repos:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
@@ -105,7 +105,7 @@ def mirror_install(distro, repo_url, gpg_url, adjust_repos):
 
         distro.conn.remote_module.write_yum_repo(ceph_repo_content)
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'zypper',
@@ -128,7 +128,7 @@ def repo_install(distro, reponame, baseurl, gpgkey, **kw):
     baseurl = baseurl.strip('/')  # Remove trailing slashes
 
     if gpgkey:
-        process.run(
+        remoto.process.run(
             distro.conn,
             [
                 'rpm',
index a6c4be2b63948045a4c616a16f51f0ecdb210360..5c0b9bfe890b18b9a3a4dffaf9f54f204a9b2040 100644 (file)
@@ -1,12 +1,12 @@
 from ceph_deploy.hosts import common
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def create(distro, args, monitor_keyring):
     hostname = distro.conn.remote_module.shortname()
     common.mon_create(distro, args, monitor_keyring, hostname)
 
-    process.run(
+    remoto.process.run(
         distro.conn,
         [
             'rcceph',
index 740f6f31f338f161aa0ed8162813ec9da66b1087..9d815e738ee718eb6eb4e348bb2d9a1974a7e8ee 100644 (file)
@@ -1,4 +1,4 @@
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def uninstall(conn, purge=False):
@@ -16,4 +16,4 @@ def uninstall(conn, purge=False):
         ]
 
     cmd.extend(packages)
-    process.run(conn, cmd)
+    remoto.process.run(conn, cmd)
index 5ef702723c7d3f3b69d5fa123c1a51a1e234101b..f4ebb0277d6e2e755bd4a6502edf1b85f7ad1c9e 100644 (file)
@@ -5,7 +5,7 @@ from ceph_deploy.util import pkg_managers
 class TestRPM(object):
 
     def setup(self):
-        self.to_patch = 'ceph_deploy.util.pkg_managers.process.run'
+        self.to_patch = 'ceph_deploy.util.pkg_managers.remoto.process.run'
 
     def test_normal_flags(self):
         fake_run = Mock()
@@ -27,7 +27,7 @@ class TestRPM(object):
 class TestApt(object):
 
     def setup(self):
-        self.to_patch = 'ceph_deploy.util.pkg_managers.process.run'
+        self.to_patch = 'ceph_deploy.util.pkg_managers.remoto.process.run'
 
     def test_install_single_package(self):
         fake_run = Mock()
@@ -65,7 +65,7 @@ class TestApt(object):
 class TestYum(object):
 
     def setup(self):
-        self.to_patch = 'ceph_deploy.util.pkg_managers.process.run'
+        self.to_patch = 'ceph_deploy.util.pkg_managers.remoto.process.run'
 
     def test_install_single_package(self):
         fake_run = Mock()
@@ -103,7 +103,7 @@ class TestYum(object):
 class TestZypper(object):
 
     def setup(self):
-        self.to_patch = 'ceph_deploy.util.pkg_managers.process.run'
+        self.to_patch = 'ceph_deploy.util.pkg_managers.remoto.process.run'
 
     def test_install_single_package(self):
         fake_run = Mock()
index b0a598da07f32b4f3ce571e82e4a7016695e3451..898511214977136bdee83c777758ecb4169cdc7e 100644 (file)
@@ -1,4 +1,4 @@
-from ceph_deploy.lib.remoto import process
+from ceph_deploy.lib import remoto
 
 
 def apt(conn, packages, *a, **kw):
@@ -12,7 +12,7 @@ def apt(conn, packages, *a, **kw):
         '--assume-yes',
     ]
     cmd.extend(packages)
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
@@ -37,7 +37,7 @@ def apt_remove(conn, packages, *a, **kw):
         cmd.append('--purge')
     cmd.extend(packages)
 
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
@@ -51,7 +51,7 @@ def apt_update(conn):
         '-q',
         'update',
     ]
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
     )
@@ -67,7 +67,7 @@ def yum(conn, packages, *a, **kw):
         'install',
     ]
     cmd.extend(packages)
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
@@ -86,7 +86,7 @@ def yum_remove(conn, packages, *a, **kw):
         cmd.append(packages)
     else:
         cmd.extend(packages)
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
@@ -102,7 +102,7 @@ def yum_clean(conn, item=None):
         item,
     ]
 
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
     )
@@ -119,7 +119,7 @@ def rpm(conn, rpm_args=None, *a, **kw):
         '-Uvh',
     ]
     cmd.extend(rpm_args)
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
@@ -138,7 +138,7 @@ def zypper(conn, packages, *a, **kw):
     ]
 
     cmd.extend(packages)
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
@@ -158,7 +158,7 @@ def zypper_remove(conn, packages, *a, **kw):
         cmd.append(packages)
     else:
         cmd.extend(packages)
-    return process.run(
+    return remoto.process.run(
         conn,
         cmd,
         *a,
index 3d38998eed97fb8bffb9977ebf94c5c8002fc690..1478a04edb7c047d9864c785c9d312248e186552 100644 (file)
@@ -1,6 +1,5 @@
 import logging
-from ceph_deploy.lib.remoto import process
-from ceph_deploy.lib.remoto.connection import needs_ssh
+from ceph_deploy.lib import remoto
 from ceph_deploy.connection import get_local_connection
 
 
@@ -13,14 +12,14 @@ def can_connect_passwordless(hostname):
     denied`` message.
     """
     # Ensure we are not doing this for local hosts
-    if not needs_ssh(hostname):
+    if not remoto.connection.needs_ssh(hostname):
         return True
 
     logger = logging.getLogger(hostname)
     with get_local_connection(logger) as conn:
         # Check to see if we can login, disabling password prompts
         command = ['ssh', '-CT', '-o', 'BatchMode=yes', hostname]
-        out, err, retval = process.check(conn, command, stop_on_error=False)
+        out, err, retval = remoto.process.check(conn, command, stop_on_error=False)
         expected_error = 'Permission denied '
         has_key_error = False
         for line in err: