summaryrefslogtreecommitdiff
path: root/data/live-build-config
diff options
context:
space:
mode:
authorerkin <e.altunbas@vyos.io>2021-11-09 16:58:15 +0300
committererkin <e.altunbas@vyos.io>2021-11-09 16:58:15 +0300
commit28dcbd7928d09fcb4ed3b10ad74a9cff47ea8863 (patch)
tree503077d2e0453144806e092a040cffbfdbf2e3cb /data/live-build-config
parentc76084a931e8cc42107ab5db6742804b970a320b (diff)
downloadvyos-build-28dcbd7928d09fcb4ed3b10ad74a9cff47ea8863.tar.gz
vyos-build-28dcbd7928d09fcb4ed3b10ad74a9cff47ea8863.zip
T3962: Check if open-vm-tools is present before attempting to write its config
Diffstat (limited to 'data/live-build-config')
-rwxr-xr-xdata/live-build-config/hooks/live/30-openvmtools-configs.chroot8
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.')