[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. b5f30037cdc55e58963602a1e8eac2609c4724cd
Steffen Moeller
steffen_moeller at gmx.de
Sun Jun 21 17:18:58 UTC 2009
The following commit has been merged in the master branch:
commit b5f30037cdc55e58963602a1e8eac2609c4724cd
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date: Sun Jun 21 19:18:07 2009 +0200
Testing for existence of non-essential files
to prevent errors at runtime.
diff --git a/VMBuilder/plugins/ubuntu/dapper.py b/VMBuilder/plugins/ubuntu/dapper.py
index 7c6887b..264f65b 100644
--- a/VMBuilder/plugins/ubuntu/dapper.py
+++ b/VMBuilder/plugins/ubuntu/dapper.py
@@ -318,8 +318,15 @@ class Dapper(suite.Suite):
os.makedirs('%s/var/lock' % fs.mntpath)
def copy_settings(self):
- self.copy_to_target('/etc/default/locale', '/etc/default/locale')
- self.copy_to_target('/etc/timezone', '/etc/timezone')
+ if os.path.exists("/etc/default/locale"):
+ self.copy_to_target('/etc/default/locale', '/etc/default/locale')
+ else:
+ logging.info("Local file '/etc/default/locale' is not available, not copied to target.")
+
+ if os.path.exists("/etc/timezone"):
+ self.copy_to_target('/etc/timezone', '/etc/timezone')
+ else:
+ logging.info("Local file '/etc/timezone' not available, not copied to target. Consider to run 'dpkg-reconfigure tzdata' and the rerun this script.")
self.run_in_target('dpkg-reconfigure', '-fnoninteractive', '-pcritical', 'libc6')
self.run_in_target('locale-gen', 'en_US')
if self.vm.lang:
diff --git a/VMBuilder/plugins/ubuntu/edgy.py b/VMBuilder/plugins/ubuntu/edgy.py
index 4c9742e..9b070f4 100644
--- a/VMBuilder/plugins/ubuntu/edgy.py
+++ b/VMBuilder/plugins/ubuntu/edgy.py
@@ -55,7 +55,10 @@ proc /proc proc defaults
shutil.rmtree(csdir)
self.copy_to_target('/etc/console-setup', '/etc/console-setup')
self.copy_to_target('/etc/default/console-setup', '/etc/default/console-setup')
- self.copy_to_target('/etc/timezone', '/etc/timezone')
+ if os.path.exists('/etc/timezone'):
+ self.copy_to_target('/etc/timezone', '/etc/timezone')
+ else:
+ logging.info("Local file '/etc/timezone' not available, not copied to target, consider to run 'dpkg-reconfigure tzdata' and restart.")
self.run_in_target('dpkg-reconfigure', '-fnoninteractive', '-pcritical', 'tzdata')
self.run_in_target('locale-gen', 'en_US')
if self.vm.lang:
--
Tool for creating VM images.
More information about the Pkg-escience-soc2009
mailing list