]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/ssh,cephadm: ceph-daemon -> cephadm
authorSage Weil <sage@redhat.com>
Wed, 11 Dec 2019 21:17:38 +0000 (15:17 -0600)
committerSage Weil <sage@redhat.com>
Thu, 12 Dec 2019 01:14:18 +0000 (19:14 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm
src/pybind/mgr/ssh/module.py
src/pybind/mgr/ssh/tests/test_ssh.py

index b9b4bf2d264930fce8d57f385c0eb21ce450fc3d..98fe30b6d68600fa7302b8846f080be52c32053b 100755 (executable)
@@ -780,7 +780,7 @@ def install_base_units(fsid):
         first child (bash), but that isn't the ceph daemon.  This is simpler and
         should be harmless.
         """
-        f.write("""# created by ceph-daemon
+        f.write("""# created by cephadm
 /var/log/ceph/%s/*.log {
     rotate 7
     daily
@@ -1551,7 +1551,7 @@ def list_daemons(detail=True, legacy_dir=None):
                     else:
                         continue
                     i = {
-                        'style': 'ceph-daemon:v1',
+                        'style': 'cephadm:v1',
                         'name': name,
                         'fsid': fsid,
                     }
@@ -1685,7 +1685,7 @@ def command_rm_cluster():
     for d in list_daemons(detail=False):
         if d['fsid'] != args.fsid:
             continue
-        if d['style'] != 'ceph-daemon:v1':
+        if d['style'] != 'cephadm:v1':
             continue
         unit_name = get_unit_name(args.fsid, d['name'])
         call(['systemctl', 'stop', unit_name],
@@ -2095,11 +2095,11 @@ if __name__ == "__main__":
         logging.basicConfig(level=logging.DEBUG)
     else:
         logging.basicConfig(level=logging.INFO)
-    logger = logging.getLogger('ceph-daemon')
+    logger = logging.getLogger('cephadm')
 
     # root?
     if os.geteuid() != 0:
-        sys.stderr.write('ERROR: ceph-daemon should be run as root\n')
+        sys.stderr.write('ERROR: cephadm should be run as root\n')
         sys.exit(1)
 
     # podman or docker?
index bbceb2f05608a601b0b4f751afe70f51d57ba7a4..754db072843941cf41e1c52b3a7f7fcb5f4d95d9 100644 (file)
@@ -279,7 +279,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
         path = self.get_ceph_option('cephadm_path')
         try:
             with open(path, 'r') as f:
-                self._ceph_daemon = f.read()
+                self._cephadm = f.read()
         except (IOError, TypeError) as e:
             raise RuntimeError("unable to read cephadm at '%s': %s" % (
                 path, str(e)))
@@ -541,8 +541,8 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
         'name=host,type=CephString',
         'Check whether we can access and manage a remote host')
     def _check_host(self, host):
-        out, err, code = self._run_ceph_daemon(host, '', 'check-host', [],
-                                               error_ok=True, no_fsid=True)
+        out, err, code = self._run_cephadm(host, '', 'check-host', [],
+                                           error_ok=True, no_fsid=True)
         if code:
             return 1, '', err
         return 0, 'host ok', err
@@ -552,8 +552,8 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
         'name=host,type=CephString',
         'Try to prepare a host for remote management')
     def _prepare_host(self, host):
-        out, err, code = self._run_ceph_daemon(host, '', 'prepare-host', [],
-                                               error_ok=True, no_fsid=True)
+        out, err, code = self._run_cephadm(host, '', 'prepare-host', [],
+                                           error_ok=True, no_fsid=True)
         if code:
             return 1, '', err
         return 0, 'host ok', err
@@ -590,13 +590,13 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
             executable_path))
         return executable_path
 
-    def _run_ceph_daemon(self, host, entity, command, args,
-                         stdin=None,
-                         no_fsid=False,
-                         error_ok=False,
-                         image=None):
+    def _run_cephadm(self, host, entity, command, args,
+                     stdin=None,
+                     no_fsid=False,
+                     error_ok=False,
+                     image=None):
         """
-        Run ceph-daemon on the remote host with the given command + args
+        Run cephadm on the remote host with the given command + args
         """
         conn = self._get_connection(host)
 
@@ -625,7 +625,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
                 script = 'injected_argv = ' + json.dumps(final_args) + '\n'
                 if stdin:
                     script += 'injected_stdin = ' + json.dumps(stdin) + '\n'
-                script += self._ceph_daemon
+                script += self._cephadm
                 out, err, code = remoto.process.check(
                     conn,
                     ['/usr/bin/python', '-u'],
@@ -727,7 +727,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
 
     @async_map_completion
     def _refresh_host_services(self, host):
-        out, err, code = self._run_ceph_daemon(
+        out, err, code = self._run_cephadm(
             host, 'mon', 'ls', [], no_fsid=True)
         data = json.loads(''.join(out))
         self.log.error('refreshed host %s services: %s' % (host, data))
@@ -761,8 +761,8 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
             result = []
             for host, ls in services.items():
                 for d in ls:
-                    if not d['style'].startswith('ceph-daemon'):
-                        self.log.debug('ignoring non-ceph-daemon on %s: %s' % (host, d))
+                    if not d['style'].startswith('cephadm'):
+                        self.log.debug('ignoring non-cephadm on %s: %s' % (host, d))
                         continue
                     if d['fsid'] != self._cluster_fsid:
                         self.log.debug('ignoring foreign daemon on %s: %s' % (host, d))
@@ -863,7 +863,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
         }
         name = '%s.%s' % (service_type, service_id)
         for a in actions[action]:
-            out, err, code = self._run_ceph_daemon(
+            out, err, code = self._run_cephadm(
                 host, name, 'unit',
                 ['--name', name, a],
                 error_ok=True)
@@ -894,7 +894,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
 
             if host_info.outdated(self.inventory_cache_timeout) or refresh:
                 self.log.info("refresh stale inventory for '{}'".format(host))
-                out, err, code = self._run_ceph_daemon(
+                out, err, code = self._run_cephadm(
                     host, 'osd',
                     'ceph-volume',
                     ['--', 'inventory', '--format=json'])
@@ -919,7 +919,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
                     'on' if on else 'off'),
                 '--path', '/dev/' + dev,
             ]
-            out, err, code = self._run_ceph_daemon(
+            out, err, code = self._run_cephadm(
                 host, 'osd', 'shell', ['--'] + cmd,
                 error_ok=True)
             if code:
@@ -961,7 +961,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
 
         devices = drive_group.data_devices.paths
         for device in devices:
-            out, err, code = self._run_ceph_daemon(
+            out, err, code = self._run_cephadm(
                 host, 'osd', 'ceph-volume',
                 [
                     '--config-and-keyring', '-',
@@ -975,7 +975,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
             self.log.debug('ceph-volume prepare: %s' % out)
 
         # check result
-        out, err, code = self._run_ceph_daemon(
+        out, err, code = self._run_cephadm(
             host, 'osd', 'ceph-volume',
             [
                 '--',
@@ -1055,7 +1055,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
                 'crash_keyring': crash_keyring,
             })
 
-            out, err, code = self._run_ceph_daemon(
+            out, err, code = self._run_cephadm(
                 host, name, 'deploy',
                 [
                     '--name', name,
@@ -1079,7 +1079,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
         """
         Remove a daemon
         """
-        out, err, code = self._run_ceph_daemon(
+        out, err, code = self._run_cephadm(
             host, name, 'rm-daemon',
             ['--name', name])
         self.log.debug('_remove_daemon code %s out %s' % (code, out))
@@ -1442,7 +1442,7 @@ class SSHOrchestrator(MgrModule, orchestrator.Orchestrator):
         if not host:
             raise OrchestratorError('no hosts defined')
         self.log.debug('using host %s' % host)
-        out, code = self._run_ceph_daemon(
+        out, code = self._run_cephadm(
             host, None, 'pull', [],
             image=image_name,
             no_fsid=True)
index 868b39b52aee549dd8054526dd90604b1a9c311f..ad72b35e354a162664aa1b37a55280ba75f58487 100644 (file)
@@ -25,7 +25,7 @@ TODOs:
 
 
 
-def _run_ceph_daemon(ret):
+def _run_cephadm(ret):
     def foo(*args, **kwargs):
         return ret, '', 0
     return foo
@@ -67,19 +67,19 @@ class TestSSH(object):
         c = ssh_module.get_hosts()
         assert self._wait(ssh_module, c) == []
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('[]'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('[]'))
     def test_service_ls(self, ssh_module):
         with self._with_host(ssh_module, 'test'):
             c = ssh_module.describe_service()
             assert self._wait(ssh_module, c) == []
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('[]'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('[]'))
     def test_device_ls(self, ssh_module):
         with self._with_host(ssh_module, 'test'):
             c = ssh_module.get_inventory()
             assert self._wait(ssh_module, c) == [InventoryNode('test')]
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('[]'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('[]'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")
@@ -88,7 +88,7 @@ class TestSSH(object):
             c = ssh_module.update_mons(1, [parse_host_specs('test:0.0.0.0=a')])
             assert self._wait(ssh_module, c) == ["(Re)deployed mon.a on host 'test'"]
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('[]'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('[]'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")
@@ -99,7 +99,7 @@ class TestSSH(object):
             assert "(Re)deployed mgr." in out
             assert " on host 'test'" in out
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('{}'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('{}'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")
@@ -109,7 +109,7 @@ class TestSSH(object):
             c = ssh_module.create_osds(dg)
             assert self._wait(ssh_module, c) == "Created osd(s) on host 'test'"
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('{}'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('{}'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")
@@ -121,7 +121,7 @@ class TestSSH(object):
             assert "(Re)deployed mds.name." in out
             assert " on host 'test'" in out
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('{}'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('{}'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")
@@ -133,11 +133,11 @@ class TestSSH(object):
             assert "(Re)deployed rgw.realm.zone." in out
             assert " on host 'test'" in out
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon(
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm(
         json.dumps([
             dict(
                 name='rgw.myrgw.foobar',
-                style='ceph-daemon',
+                style='cephadm',
                 fsid='fsid',
                 container_id='container_id',
                 version='version',
@@ -152,7 +152,7 @@ class TestSSH(object):
             out = self._wait(ssh_module, c)
             assert out == ["Removed rgw.myrgw.foobar from host 'test'"]
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('{}'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('{}'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")
@@ -164,7 +164,7 @@ class TestSSH(object):
             assert "(Re)deployed rbd-mirror." in out
             assert " on host 'test'" in out
 
-    @mock.patch("ssh.module.SSHOrchestrator._run_ceph_daemon", _run_ceph_daemon('{}'))
+    @mock.patch("ssh.module.SSHOrchestrator._run_cephadm", _run_cephadm('{}'))
     @mock.patch("ssh.module.SSHOrchestrator.send_command")
     @mock.patch("ssh.module.SSHOrchestrator.mon_command", mon_command)
     @mock.patch("ssh.module.SSHOrchestrator._get_connection")