do not fail if log can't be crated
This commit is contained in:
parent
f85b0bac01
commit
617f0db570
1 changed files with 5 additions and 3 deletions
|
@ -26,7 +26,6 @@ def main():
|
||||||
conduit_token = os.environ['CONDUIT_TOKEN']
|
conduit_token = os.environ['CONDUIT_TOKEN']
|
||||||
host = os.environ['PHABRICATOR_HOST']
|
host = os.environ['PHABRICATOR_HOST']
|
||||||
diff_json_path = os.environ['DIFF_JSON']
|
diff_json_path = os.environ['DIFF_JSON']
|
||||||
print('Applying patch for Phabricator diff {} for build {}'.format(diff_id,phid))
|
|
||||||
phab = Phabricator(token=conduit_token, host=host+'/api/')
|
phab = Phabricator(token=conduit_token, host=host+'/api/')
|
||||||
phab.update_interfaces()
|
phab.update_interfaces()
|
||||||
|
|
||||||
|
@ -37,8 +36,11 @@ def main():
|
||||||
def _get_parent_hash(diff_id: str, phab: Phabricator, diff_json_path: str) -> str:
|
def _get_parent_hash(diff_id: str, phab: Phabricator, diff_json_path: str) -> str:
|
||||||
diff = phab.differential.getdiff(diff_id=diff_id)
|
diff = phab.differential.getdiff(diff_id=diff_id)
|
||||||
# Keep a copy of the Phabricator answer for later usage in a json file
|
# Keep a copy of the Phabricator answer for later usage in a json file
|
||||||
|
try:
|
||||||
with open(diff_json_path,'w') as json_file:
|
with open(diff_json_path,'w') as json_file:
|
||||||
json.dump(diff.response, json_file, sort_keys=True, indent=4)
|
json.dump(diff.response, json_file, sort_keys=True, indent=4)
|
||||||
|
except Exception:
|
||||||
|
print('WARNING: could not write build/diff.json log file')
|
||||||
return diff['sourceControlBaseRevision']
|
return diff['sourceControlBaseRevision']
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue