|
28 | 28 | from . import chassis_modules
|
29 | 29 | from . import console
|
30 | 30 | from . import feature
|
| 31 | +from . import kdump |
31 | 32 | from . import kube
|
32 | 33 | from . import mlnx
|
33 | 34 | from . import muxcable
|
@@ -878,6 +879,7 @@ def config(ctx):
|
878 | 879 | config.add_command(chassis_modules.chassis_modules)
|
879 | 880 | config.add_command(console.console)
|
880 | 881 | config.add_command(feature.feature)
|
| 882 | +config.add_command(kdump.kdump) |
881 | 883 | config.add_command(kube.kubernetes)
|
882 | 884 | config.add_command(muxcable.muxcable)
|
883 | 885 | config.add_command(nat.nat)
|
@@ -1901,50 +1903,6 @@ def shutdown():
|
1901 | 1903 | """Shut down BGP session(s)"""
|
1902 | 1904 | pass
|
1903 | 1905 |
|
1904 |
| -@config.group(cls=clicommon.AbbreviationGroup) |
1905 |
| -def kdump(): |
1906 |
| - """ Configure kdump """ |
1907 |
| - if os.geteuid() != 0: |
1908 |
| - exit("Root privileges are required for this operation") |
1909 |
| - |
1910 |
| -@kdump.command() |
1911 |
| -def disable(): |
1912 |
| - """Disable kdump operation""" |
1913 |
| - config_db = ConfigDBConnector() |
1914 |
| - if config_db is not None: |
1915 |
| - config_db.connect() |
1916 |
| - config_db.mod_entry("KDUMP", "config", {"enabled": "false"}) |
1917 |
| - clicommon.run_command("sonic-kdump-config --disable") |
1918 |
| - |
1919 |
| -@kdump.command() |
1920 |
| -def enable(): |
1921 |
| - """Enable kdump operation""" |
1922 |
| - config_db = ConfigDBConnector() |
1923 |
| - if config_db is not None: |
1924 |
| - config_db.connect() |
1925 |
| - config_db.mod_entry("KDUMP", "config", {"enabled": "true"}) |
1926 |
| - clicommon.run_command("sonic-kdump-config --enable") |
1927 |
| - |
1928 |
| -@kdump.command() |
1929 |
| -@click.argument('kdump_memory', metavar='<kdump_memory>', required=True) |
1930 |
| -def memory(kdump_memory): |
1931 |
| - """Set memory allocated for kdump capture kernel""" |
1932 |
| - config_db = ConfigDBConnector() |
1933 |
| - if config_db is not None: |
1934 |
| - config_db.connect() |
1935 |
| - config_db.mod_entry("KDUMP", "config", {"memory": kdump_memory}) |
1936 |
| - clicommon.run_command("sonic-kdump-config --memory %s" % kdump_memory) |
1937 |
| - |
1938 |
| -@kdump.command('num-dumps') |
1939 |
| -@click.argument('kdump_num_dumps', metavar='<kdump_num_dumps>', required=True, type=int) |
1940 |
| -def num_dumps(kdump_num_dumps): |
1941 |
| - """Set max number of dump files for kdump""" |
1942 |
| - config_db = ConfigDBConnector() |
1943 |
| - if config_db is not None: |
1944 |
| - config_db.connect() |
1945 |
| - config_db.mod_entry("KDUMP", "config", {"num_dumps": kdump_num_dumps}) |
1946 |
| - clicommon.run_command("sonic-kdump-config --num_dumps %d" % kdump_num_dumps) |
1947 |
| - |
1948 | 1906 | # 'all' subcommand
|
1949 | 1907 | @shutdown.command()
|
1950 | 1908 | @click.option('-v', '--verbose', is_flag=True, help="Enable verbose output")
|
|
0 commit comments