@@ -409,14 +409,6 @@ def _abort_if_false(ctx, param, value):
409
409
if not value :
410
410
ctx .abort ()
411
411
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
-
420
412
def _stop_services ():
421
413
# on Mellanox platform pmon is stopped by syncd
422
414
services_to_stop = [
@@ -447,17 +439,6 @@ def _stop_services():
447
439
log_error ("Stopping {} failed with error {}" .format (service , e ))
448
440
raise
449
441
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
-
461
442
def _reset_failed_services ():
462
443
services_to_reset = [
463
444
'bgp' ,
@@ -493,17 +474,6 @@ def _reset_failed_services():
493
474
log_error ("Failed to reset failed status for service {}" .format (service ))
494
475
raise
495
476
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
-
507
477
def _restart_services ():
508
478
# on Mellanox platform pmon is started by syncd
509
479
services_to_restart = [
@@ -538,17 +508,6 @@ def _restart_services():
538
508
log_error ("Restart {} failed with error {}" .format (service , e ))
539
509
raise
540
510
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
-
552
511
def is_ipaddress (val ):
553
512
""" Validate if an entry is a valid IP """
554
513
if not val :
0 commit comments