summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-03-22 13:40:22 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2018-03-22 13:40:22 -0700
commit6f708314978187243424be89f4f6c0a1d14cb338 (patch)
tree1e87639b1ebc70faf6d9a7dd5774e14d3b3d446b
parent34687c0bcbe0d23b0734d75936468aa83b2a71d7 (diff)
Fix Python3 Errors for Release Automation
My testing was done using Python 2.7 but the build server running the jobs is obviously running Python3. These changes allow the create_branch.py release script to run against both Python2 and Python3. Change-Id: I02478986ef869ce82ece5b96dbb4b5ed548a2a55 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
-rw-r--r--releases/scripts/create_branch.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/releases/scripts/create_branch.py b/releases/scripts/create_branch.py
index 8de130972..362aaaf99 100644
--- a/releases/scripts/create_branch.py
+++ b/releases/scripts/create_branch.py
@@ -12,7 +12,12 @@ Create Gerrit Branchs
"""
import argparse
-import ConfigParser
+
+try:
+ import ConfigParser
+except ImportError:
+ import configparser as ConfigParser
+
import logging
import os
import yaml
@@ -105,7 +110,7 @@ def main():
try:
auth = GerritAuth(url=gerrit_url)
- except ValueError, err:
+ except ValueError as err:
logging.error("%s for %s", err, gerrit_url)
quit(1)
restapi = GerritRestAPI(url=gerrit_url, auth=auth)