diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-05-18 18:57:32 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-05-18 18:59:34 +0200 |
commit | 75e5ce2d25b019a4d805217859dbb340a48f4713 (patch) | |
tree | 8f8a375fee82a02d2d2d74b3ed0ee0d4a6fd4564 /src/etc/vmware-tools | |
parent | ea96466e46374a810a4d21d4209e6a30feb45de3 (diff) | |
download | vyos-1x-75e5ce2d25b019a4d805217859dbb340a48f4713.tar.gz vyos-1x-75e5ce2d25b019a4d805217859dbb340a48f4713.zip |
vmware: T1028: properly expose syslog identity
(cherry picked from commit 7de7a1b2d127df85d4224162116c1d4c984b022b)
Diffstat (limited to 'src/etc/vmware-tools')
-rwxr-xr-x | src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py b/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py index dc751c45c..111da5601 100755 --- a/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py +++ b/src/etc/vmware-tools/scripts/resume-vm-default.d/ether-resume.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018-2020 VyOS maintainers and contributors +# Copyright (C) 2018-2021 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -15,13 +15,12 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import sys -import syslog as sl +import syslog from vyos.config import Config from vyos import ConfigError from vyos.util import run - def get_config(): c = Config() interfaces = dict() @@ -39,12 +38,14 @@ def get_config(): interfaces[intf] = [addr.strip("'") for addr in intf_addresses] return interfaces - def apply(config): + syslog.openlog(ident='ether-resume', logoption=syslog.LOG_PID, + facility=syslog.LOG_INFO) + for intf, addresses in config.items(): # bring the interface up cmd = ["ip", "link", "set", "dev", intf, "up"] - sl.syslog(sl.LOG_NOTICE, " ".join(cmd)) + syslog.syslog(cmd) run(cmd) # add configured addresses to interface @@ -53,10 +54,9 @@ def apply(config): cmd = ["dhclient", intf] else: cmd = ["ip", "address", "add", addr, "dev", intf] - sl.syslog(sl.LOG_NOTICE, " ".join(cmd)) + syslog.syslog(cmd) run(cmd) - if __name__ == '__main__': try: config = get_config() |