summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitesh Kanjariya <mitesh@marvel-07.cumulusnetworks.com>2018-02-07 14:46:04 -0800
committermitesh <mitesh@cumulusnetworks.com>2018-02-08 23:04:05 -0800
commit3b103fec6be8073eb5f4da86a8a45b8f6d7e708f (patch)
treef3af9b08781d3fb232c6a6d4b99a0fc09af93ea1
parentd1911c2664cf84aa674d433396bbdecf2db9d3eb (diff)
vtysh/lib: write domainname to config file
Ticket: CM-19626 Review: CCR-7170 Testing: Manual Signed-off-by: Mitesh Kanjariya <mitesh@cumulusnetworks.com>
-rw-r--r--lib/command.c3
-rw-r--r--vtysh/vtysh_config.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/command.c b/lib/command.c
index d17f2c3d48..6870f4804b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -500,6 +500,9 @@ static int config_write_host(struct vty *vty)
if (cmd_hostname_get())
vty_out(vty, "hostname %s\n", cmd_hostname_get());
+ if (cmd_domainname_get())
+ vty_out(vty, "domainname %s\n", cmd_domainname_get());
+
if (host.encrypt) {
if (host.password_encrypt)
vty_out(vty, "password 8 %s\n", host.password_encrypt);
diff --git a/vtysh/vtysh_config.c b/vtysh/vtysh_config.c
index 967f855fbc..5ba749e66f 100644
--- a/vtysh/vtysh_config.c
+++ b/vtysh/vtysh_config.c
@@ -448,6 +448,11 @@ void vtysh_config_write()
sprintf(line, "hostname %s", cmd_hostname_get());
vtysh_config_parse_line(NULL, line);
}
+
+ if (cmd_domainname_get()) {
+ sprintf(line, "domainname %s", cmd_domainname_get());
+ vtysh_config_parse_line(NULL, line);
+ }
if (vtysh_write_integrated == WRITE_INTEGRATED_NO)
vtysh_config_parse_line(NULL,
"no service integrated-vtysh-config");