From 7944ea3067a32a8bf470abbb1f54f05c3f0d07f8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 31 Oct 2013 19:05:38 +0530 Subject: [PATCH] [minor] [fix] plugin patch --- patches/october_2013/p05_server_custom_script_to_file.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/patches/october_2013/p05_server_custom_script_to_file.py b/patches/october_2013/p05_server_custom_script_to_file.py index 3a7e7702652..b1d4f2116d5 100644 --- a/patches/october_2013/p05_server_custom_script_to_file.py +++ b/patches/october_2013/p05_server_custom_script_to_file.py @@ -21,8 +21,12 @@ def execute(): for name, dt, script in webnotes.conn.sql("""select name, dt, script from `tabCustom Script` where script_type='Server'"""): if script.strip(): - script = indent_using_tabs(script) - make_custom_server_script_file(dt, script) + try: + script = indent_using_tabs(script) + make_custom_server_script_file(dt, script) + except IOError, e: + if "already exists" not in repr(e): + raise def indent_using_tabs(script): for line in script.split("\n"):