@@ -409,14 +409,6 @@ def _abort_if_false(ctx, param, value):
409409 if not value :
410410 ctx .abort ()
411411
412- def _get_optional_services ():
413- config_db = ConfigDBConnector ()
414- config_db .connect ()
415- optional_services_dict = config_db .get_table ('FEATURE' )
416- if not optional_services_dict :
417- return None
418- return optional_services_dict .keys ()
419-
420412def _stop_services ():
421413 # on Mellanox platform pmon is stopped by syncd
422414 services_to_stop = [
@@ -447,17 +439,6 @@ def _stop_services():
447439 log_error ("Stopping {} failed with error {}" .format (service , e ))
448440 raise
449441
450- # For optional services they don't start by default
451- for service in _get_optional_services ():
452- (out , err ) = run_command ("systemctl status {}" .format (service ), return_output = True )
453- if not err and 'Active: active (running)' in out :
454- try :
455- click .echo ("Stopping service {} ..." .format (service ))
456- run_command ("systemctl stop {}" .format (service ))
457- except SystemExit as e :
458- log_error ("Stopping {} failed with error {}" .format (service , e ))
459- raise
460-
461442def _reset_failed_services ():
462443 services_to_reset = [
463444 'bgp' ,
@@ -493,17 +474,6 @@ def _reset_failed_services():
493474 log_error ("Failed to reset failed status for service {}" .format (service ))
494475 raise
495476
496- # For optional services they don't start by default
497- for service in _get_optional_services ():
498- (out , err ) = run_command ("systemctl is-enabled {}" .format (service ), return_output = True )
499- if not err and 'enabled' in out :
500- try :
501- click .echo ("Resetting failed status for service {} ..." .format (service ))
502- run_command ("systemctl reset-failed {}" .format (service ))
503- except SystemExit as e :
504- log_error ("Failed to reset failed status for service {}" .format (service ))
505- raise
506-
507477def _restart_services ():
508478 # on Mellanox platform pmon is started by syncd
509479 services_to_restart = [
@@ -538,17 +508,6 @@ def _restart_services():
538508 log_error ("Restart {} failed with error {}" .format (service , e ))
539509 raise
540510
541- # For optional services they don't start by default
542- for service in _get_optional_services ():
543- (out , err ) = run_command ("systemctl is-enabled {}" .format (service ), return_output = True )
544- if not err and 'enabled' in out :
545- try :
546- click .echo ("Restarting service {} ..." .format (service ))
547- run_command ("systemctl restart {}" .format (service ))
548- except SystemExit as e :
549- log_error ("Restart {} failed with error {}" .format (service , e ))
550- raise
551-
552511def is_ipaddress (val ):
553512 """ Validate if an entry is a valid IP """
554513 if not val :
0 commit comments