summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorerkin <e.altunbas@vyos.io>2021-11-09 17:01:41 +0300
committererkin <e.altunbas@vyos.io>2021-11-09 17:01:41 +0300
commit876cc8810e649f87fd5b4d6a1127f3d7136655ea (patch)
treec9ea0bc2d65d41e178632cb832e013ee4f587ed2 /data
parentf150b107202497350a9a8984f33bc8b4e30e567e (diff)
downloadvyos-build-876cc8810e649f87fd5b4d6a1127f3d7136655ea.tar.gz
vyos-build-876cc8810e649f87fd5b4d6a1127f3d7136655ea.zip
T3962: Check if open-vm-tools is present before attempting to write its config
Diffstat (limited to 'data')
-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.')