When writing new NTP servers configuration the temporary file has to be closed before moving it to the right place.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ntp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ntp.py b/pyanaconda/ntp.py index 0fed009..006bef7 100644 --- a/pyanaconda/ntp.py +++ b/pyanaconda/ntp.py @@ -135,6 +135,9 @@ def save_servers_to_config(servers, conf_file_path=NTP_CONFIG_FILE, if not srv_regexp.match(line) and line != heading: new_conf_file.write(line)
+ old_conf_file.close() + new_conf_file.close() + if not out_file_path: try: stat = os.stat(conf_file_path) @@ -147,9 +150,6 @@ def save_servers_to_config(servers, conf_file_path=NTP_CONFIG_FILE,
raise NTPconfigError(msg)
- old_conf_file.close() - new_conf_file.close() - def one_time_sync(server, callback=None): """ Synchronize the system time with a given NTP server. Note that this
Ack.
On 09/20/2012 01:58 PM, Vratislav Podzimek wrote:
When writing new NTP servers configuration the temporary file has to be closed before moving it to the right place.
Signed-off-by: Vratislav Podzimekvpodzime@redhat.com
pyanaconda/ntp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ntp.py b/pyanaconda/ntp.py index 0fed009..006bef7 100644 --- a/pyanaconda/ntp.py +++ b/pyanaconda/ntp.py @@ -135,6 +135,9 @@ def save_servers_to_config(servers, conf_file_path=NTP_CONFIG_FILE, if not srv_regexp.match(line) and line != heading: new_conf_file.write(line)
- old_conf_file.close()
- new_conf_file.close()
if not out_file_path: try: stat = os.stat(conf_file_path)@@ -147,9 +150,6 @@ def save_servers_to_config(servers, conf_file_path=NTP_CONFIG_FILE,
raise NTPconfigError(msg)
- old_conf_file.close()
- new_conf_file.close()
- def one_time_sync(server, callback=None): """ Synchronize the system time with a given NTP server. Note that this
anaconda-patches@lists.fedorahosted.org