summaryrefslogtreecommitdiff
path: root/src/conf_mode/host_name.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-07-12 15:36:11 +0200
committerDaniil Baturin <daniil@baturin.org>2019-07-12 15:36:11 +0200
commit37a4d98daee93f57c19d3889e0e660c7645d6303 (patch)
tree06a80bfc5114b15bdf591a214e0092b0eac1d394 /src/conf_mode/host_name.py
parent1725f958cf28578583a49462d0a9ebc707978fb3 (diff)
downloadvyos-1x-37a4d98daee93f57c19d3889e0e660c7645d6303.tar.gz
vyos-1x-37a4d98daee93f57c19d3889e0e660c7645d6303.zip
Do not try to verify the config when host_name.py is called from dhclient script.
Diffstat (limited to 'src/conf_mode/host_name.py')
-rwxr-xr-xsrc/conf_mode/host_name.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conf_mode/host_name.py b/src/conf_mode/host_name.py
index 27cc336d8..651c1c392 100755
--- a/src/conf_mode/host_name.py
+++ b/src/conf_mode/host_name.py
@@ -110,6 +110,8 @@ def get_config(arguments):
conf.return_values = conf.return_effective_values
hosts['hostname'] = conf.return_value("system host-name")
+ if not hosts['hostname']:
+ hosts['hostname'] = default_config_data['hostname']
hosts['domain_name'] = conf.return_value("system domain-name")
if hosts['domain_name']:
@@ -226,7 +228,8 @@ if __name__ == '__main__':
try:
c = get_config(args)
- verify(c)
+ if not args.dhclient:
+ verify(c)
generate(c)
apply(c)
except ConfigError as e: