]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: don't try to write client/os tuning profiles to known offline hosts 47666/head
authorAdam King <kingamk3@gmail.com>
Wed, 17 Aug 2022 23:03:18 +0000 (19:03 -0400)
committerAdam King <adking@redhat.com>
Thu, 18 Aug 2022 15:28:54 +0000 (11:28 -0400)
Fixes: https://tracker.ceph.com/issues/57175
Signed-off-by: Adam King <adking@redhat.com>
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_tuned_profiles.py
src/pybind/mgr/cephadm/tuned_profiles.py

index c12e751b5f845631dd200d65ccad2785844110b4..e94a58c84b765517024429113dd86d4ccbc0a3be 100644 (file)
@@ -1060,6 +1060,8 @@ class CephadmServe:
                             client_files: Dict[str, Dict[str, Tuple[int, int, int, bytes, str]]],
                             host: str) -> None:
         updated_files = False
+        if host in self.mgr.offline_hosts:
+            return
         old_files = self.mgr.cache.get_host_client_files(host).copy()
         for path, m in client_files.get(host, {}).items():
             mode, uid, gid, content, digest = m
index 41c0d96fcf3fe9896ac2c2f50733231ffd858aed..1521b01105231d6b92cbc4404f5e91f076c11832 100644 (file)
@@ -55,6 +55,7 @@ class FakeMgr:
         self.tuned_profiles = TunedProfileStore(self)
         self.tuned_profiles.profiles = profiles
         self.ssh = SSHManager(self)
+        self.offline_hosts = []
 
     def set_store(self, what: str, value: str):
         raise SaveError(f'{what}: {value}')
index 7a5ce6fe602854dae373770d671699564c82c06f..3f617956846ba62471702526db38c710a150c27d 100644 (file)
@@ -47,6 +47,8 @@ class TunedProfileUtils():
             self._write_tuned_profiles(host, profiles)
 
     def _remove_stray_tuned_profiles(self, host: str, profiles: List[Dict[str, str]]) -> None:
+        if host in self.mgr.offline_hosts:
+            return
         cmd = ['ls', SYSCTL_DIR]
         found_files = self.mgr.ssh.check_execute_command(host, cmd).split('\n')
         found_files = [s.strip() for s in found_files]
@@ -63,6 +65,8 @@ class TunedProfileUtils():
             self.mgr.ssh.check_execute_command(host, ['sysctl', '--system'])
 
     def _write_tuned_profiles(self, host: str, profiles: List[Dict[str, str]]) -> None:
+        if host in self.mgr.offline_hosts:
+            return
         updated = False
         for p in profiles:
             for profile_name, content in p.items():