diff options
author | erkin <e.altunbas@vyos.io> | 2021-11-09 16:58:15 +0300 |
---|---|---|
committer | erkin <e.altunbas@vyos.io> | 2021-11-09 16:58:15 +0300 |
commit | 28dcbd7928d09fcb4ed3b10ad74a9cff47ea8863 (patch) | |
tree | 503077d2e0453144806e092a040cffbfdbf2e3cb | |
parent | c76084a931e8cc42107ab5db6742804b970a320b (diff) | |
download | vyos-build-28dcbd7928d09fcb4ed3b10ad74a9cff47ea8863.tar.gz vyos-build-28dcbd7928d09fcb4ed3b10ad74a9cff47ea8863.zip |
T3962: Check if open-vm-tools is present before attempting to write its config
-rwxr-xr-x | data/live-build-config/hooks/live/30-openvmtools-configs.chroot | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/data/live-build-config/hooks/live/30-openvmtools-configs.chroot b/data/live-build-config/hooks/live/30-openvmtools-configs.chroot index e3762cc9..ed734cab 100755 --- a/data/live-build-config/hooks/live/30-openvmtools-configs.chroot +++ b/data/live-build-config/hooks/live/30-openvmtools-configs.chroot @@ -2,6 +2,7 @@ # open-vm-tools settings +import os import re vmtools_config = """ @@ -10,5 +11,8 @@ vmtools_config = """ """ -with open('/etc/vmware-tools/tools.conf', 'w') as f: - f.write(vmtools_config) +if os.path.isdir('/etc/vmware-tools'): + with open('/etc/vmware-tools/tools.conf', 'w') as f: + f.write(vmtools_config) +else: + print('Open VM Tools not found. Skipping its configuration.') |