buildframework/helium/tools/preparation/synergy/ccmgetinput.ant.xml
changeset 645 b8d81fa19e7d
parent 628 7c4a911dc066
equal deleted inserted replaced
643:27cf35f95864 645:b8d81fa19e7d
    74 import os.path
    74 import os.path
    75 
    75 
    76 # enabling logging
    76 # enabling logging
    77 logging.basicConfig(level=logging.INFO)
    77 logging.basicConfig(level=logging.INFO)
    78 
    78 
    79 builder = None           
    79 configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
    80 configSet = configBuilder.getConfiguration()
       
    81 password = ant.get_property(r'${ccm.user.password}')
       
    82 builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
    80 try:
    83 try:
    81     configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
    82     configSet = configBuilder.getConfiguration()
       
    83     password = ant.get_property(r'${ccm.user.password}')
       
    84     builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
       
    85     builder.check()
    84     builder.check()
    86     builder.get_content()
    85     builder.get_content()
       
    86 finally:
    87     builder.close()
    87     builder.close()
    88 except Exception, e:
       
    89     print "ERROR: error found during preparation phase:" 
       
    90     for l in traceback.format_exc().splitlines(False):
       
    91         print "ERROR: %s" % l         
       
    92     print "ERROR: this is a critical error, build will fail now:"
       
    93     for l in str(e).splitlines(False):
       
    94         print "ERROR: %s" % l         
       
    95     if builder != None:
       
    96         builder.close()
       
    97     sys.exit(-1)
       
    98 sys.exit(0)
       
    99                 </hlm:python>
    88                 </hlm:python>
   100             </try>
    89             </try>
   101             <finally>
    90             <finally>
   102                 <hlm:tempRecordStopMacro name="${build.id}_ccm_get_input.log" filterref="filterset.prepWorkArea" phase="prep"/>
    91                 <hlm:tempRecordStopMacro name="${build.id}_ccm_get_input.log" filterref="filterset.prepWorkArea" phase="prep"/>
   103                 <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_ccm_get_input.log" />
    92                 <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_ccm_get_input.log" />
   128 import os.path
   117 import os.path
   129 
   118 
   130 # enabling logging
   119 # enabling logging
   131 logging.basicConfig(level=logging.INFO)
   120 logging.basicConfig(level=logging.INFO)
   132 
   121 
   133 builder = None           
   122 configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
   123 configSet = configBuilder.getConfiguration()
       
   124 password = ant.get_property(r'${ccm.user.password}')
       
   125 builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
   134 try:
   126 try:
   135     configBuilder = configuration.NestedConfigurationBuilder(open(ant.get_property(r'${prep.delivery.conf.parsed}'), 'r'))
       
   136     configSet = configBuilder.getConfiguration()
       
   137     password = ant.get_property(r'${ccm.user.password}')
       
   138     builder = preparation.PreparationBuilder(configSet.getConfigurations(), ant.get_property(r'${ccm.user.login}'), password, cache=ant.get_property(r'${ccm.cache.xml}'))
       
   139     builder.cleanup()
   127     builder.cleanup()
       
   128 finally:
   140     builder.close()
   129     builder.close()
   141 except Exception, e:
       
   142     print "ERROR: error found during preparation phase:" 
       
   143     for l in traceback.format_exc().splitlines(False):
       
   144         print "ERROR: %s" % l         
       
   145     print "ERROR: this is a critical error, build will fail now:"
       
   146     for l in str(e).splitlines(False):
       
   147         print "ERROR: %s" % l         
       
   148     if builder != None:
       
   149         builder.close()
       
   150     sys.exit(-1)
       
   151 sys.exit(0)
       
   152                 </hlm:python>
   130                 </hlm:python>
   153             </try>
   131             </try>
   154             <finally>
   132             <finally>
   155                 <hlm:tempRecordStopMacro name="${build.id}_cleanup_work_area.log" filterref="filterset.prepWorkArea" phase="prep"/>
   133                 <hlm:tempRecordStopMacro name="${build.id}_cleanup_work_area.log" filterref="filterset.prepWorkArea" phase="prep"/>
   156                 <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_cleanup_work_area.log" />
   134                 <hlm:assertFileExists file="${build.cache.log.dir}/${build.id}_cleanup_work_area.log" />