import sys
import os
import datetime
+import codecs
envparas = ['OBS_EVENT_STRING',
'OBS_OSCRC_PATH',
def tag_info(prjdir, tag):
- git.update_git_project(GIT_CACHE_DIR, prjdir, GIT_URL)
-
gitprj = git.Git(os.path.join(GIT_CACHE_DIR,prjdir))
if gitprj.find_tag(tag):
return gitprj.get_tag(tag)
entry = {}
for line in section.split('\n'):
try:
- key, value = line.split(':')
+ key, value = line.split(':',1)
entry[mapping[key.strip()]] = value.strip()
except:
- print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
- print 'key:value %s:%s' %(key, value)
+ print '-------------------------------------'
+ print 'key:value %s' %(line)
pass
tag = tag_info(entry['git_project'], entry['git_tag'])
MAILINGLIST.split(','), BCC_MAILS, data, SR_ENABLE_USER, EMAIL_TEMPLATES_DIR)
print status
if status:
- with open('%s.env' %(BUILD_TAG),'w') as f:
- for a in status.keys():
- f.write('%s=%s\n' %(a, status[a]))
-
-GIT_URL="git://gerrit2.bj.intel.com"
+ with codecs.open('%s.env' %(BUILD_TAG), mode='w', encoding='utf-8') as f:
+ for key in status.keys():
+ f.write('%s=%s\n' %(key, status[key]))
event = json.loads(' '.join(OBS_EVENT_STRING.split()))
event_fields = event['fields']['obsEvent']