From: Stephen Soltesz Date: Mon, 8 Jun 2009 17:40:03 +0000 (+0000) Subject: clear immutible attribute before writing file, to address wide-spread issues X-Git-Tag: BootManager-4.3-8~2 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=4efbca47abfb8f1cd602f186ac036e8bb18ed9e2 clear immutible attribute before writing file, to address wide-spread issues seen on public pl related to 2.6.12 boot cd and 2.6.22 root context. --- diff --git a/source/steps/UpdateNodeConfiguration.py b/source/steps/UpdateNodeConfiguration.py index bca5929..ed6bdee 100644 --- a/source/steps/UpdateNodeConfiguration.py +++ b/source/steps/UpdateNodeConfiguration.py @@ -179,6 +179,17 @@ def update_vserver_network_files( vserver_dir, vars, log ): if update_files: log.write( "Updating network files in %s.\n" % vserver_dir ) + try: + # NOTE: this works around a recurring problem on public pl, + # suspected to be due to mismatch between 2.6.12 bootcd and + # 2.6.22/f8 root environment. files randomly show up with the + # immutible attribute set. this clears it before trying to write + # the files below. + utils.sysexec( "chattr -i %s/etc/hosts" % vserver_dir ) + utils.sysexec( "chattr -i %s/etc/resolv.conf" % vserver_dir ) + except: + pass + file_path= "%s/etc/hosts" % vserver_dir hosts_file= file(file_path, "w" )