File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/pybind/mgr/cephadm/services Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -192,10 +192,14 @@ def ok_to_stop(self,
192192 return HandleCommandResult (- errno .EBUSY , '' , warn_message )
193193
194194 # if reached here, there is > 1 nvmeof daemon. make sure none are down
195- warn_message = ('ALERT: 1 nvmeof daemon is already down. Please bring it back up before stopping this one' )
196- nvmeof_daemons = self .mgr .cache .get_daemons_by_type (self .TYPE )
197- for i in nvmeof_daemons :
198- if i .status != DaemonDescriptionStatus .running :
195+ if not force :
196+ warn_message = ('WARNING: Only one nvmeof daemon is running. Please bring another nvmeof daemon up before stopping the current one.' )
197+ unreachable_hosts = [h .hostname for h in self .mgr .cache .get_unreachable_hosts ()]
198+ running_nvmeof_daemons = [
199+ d for d in self .mgr .cache .get_daemons_by_type (self .TYPE )
200+ if d .status == DaemonDescriptionStatus .running and d .hostname not in unreachable_hosts
201+ ]
202+ if len (running_nvmeof_daemons ) < 2 :
199203 return HandleCommandResult (- errno .EBUSY , '' , warn_message )
200204
201205 names = [f'{ self .TYPE } .{ d_id } ' for d_id in daemon_ids ]
You can’t perform that action at this time.
0 commit comments