@@ -356,39 +356,6 @@ def write_num_dumps(num_dumps):
356
356
print_err ("Error while writing KDUMP_NUM_DUMPS into %s" % kdump_cfg )
357
357
sys .exit (1 )
358
358
359
- ## Save kdump configuration into the startup configuration
360
- # @kdump_enabled Administrative mode (False/True)
361
- # @memory Amount of memory allocated for the capture kernel
362
- # @num_dumps Max number of core files saved locally
363
- def save_config (kdump_enabled , memory , num_dumps ):
364
-
365
- configdb_fname = '/etc/sonic/config_db.json'
366
-
367
- # Read current configuration
368
- if not os .path .exists (configdb_fname ):
369
- print_err ("Startup configuration not found, Kdump configuration is not saved" )
370
- return
371
- else :
372
- try :
373
- with open (configdb_fname ) as json_file :
374
- data = json .load (json_file )
375
- except Exception as e :
376
- print_err ("Error [%s] while reading startup configuration" % e )
377
- return
378
-
379
- # Rewrite configuration
380
- try :
381
- kdump_data = {'config' : {'enabled' : '' , 'num_dumps' : '' , 'memory' : '' }}
382
- (kdump_data ['config' ])['enabled' ] = str (kdump_enabled ).lower ()
383
- (kdump_data ['config' ])['num_dumps' ] = str (num_dumps )
384
- (kdump_data ['config' ])['memory' ] = memory
385
- data ['KDUMP' ] = kdump_data
386
- with open (configdb_fname , 'w' ) as fp :
387
- json .dump (data , fp , indent = 4 , sort_keys = False )
388
- print ("Kdump configuration has been updated in the startup configuration" )
389
- except Exception as e :
390
- print_err ("Error [%s] while saving Kdump configuration to startup configuration" % e )
391
-
392
359
## Enable kdump
393
360
#
394
361
# @param verbose If True, the function will display a few additinal information
@@ -432,9 +399,6 @@ def kdump_enable(verbose, kdump_enabled, memory, num_dumps, image, cmdline_file)
432
399
433
400
if changed :
434
401
rewrite_cfg (lines , cmdline_file )
435
- save_config (kdump_enabled , memory , num_dumps )
436
- else :
437
- save_config (kdump_enabled , memory , num_dumps )
438
402
439
403
write_use_kdump (1 )
440
404
if crash_kernel_in_cmdline is not None :
@@ -545,7 +509,6 @@ def kdump_disable(verbose, kdump_enabled, memory, num_dumps, image, cmdline_file
545
509
546
510
if changed :
547
511
rewrite_grub_cfg (lines , grub_cfg )
548
- save_config (kdump_enabled , memory , num_dumps )
549
512
550
513
return changed
551
514
@@ -588,9 +551,6 @@ def cmd_kdump_memory(verbose, memory):
588
551
if memory != crash_kernel_in_cmdline or memory != memory_in_db or memory != memory_in_json :
589
552
cmd_kdump_enable (verbose )
590
553
print ("Kdump updated memory will be only operational after the system reboots" )
591
- else :
592
- num_dumps = get_kdump_num_dumps ()
593
- save_config (False , memory , num_dumps )
594
554
595
555
## Command: Set / Get num_dumps
596
556
#
@@ -603,9 +563,6 @@ def cmd_kdump_num_dumps(verbose, num_dumps):
603
563
print ('\n ' .join (lines ))
604
564
else :
605
565
write_num_dumps (num_dumps )
606
- kdump_enabled = get_kdump_administrative_mode ()
607
- kdump_memory = get_kdump_memory ()
608
- save_config (kdump_enabled , kdump_memory , num_dumps )
609
566
610
567
## Command: Display kdump status
611
568
def cmd_kdump_status ():
0 commit comments