From 199d53630926bb89c2e6822d146876aafc3e1dfa Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Thu, 27 Apr 2017 11:19:58 -0400 Subject: [PATCH] port list_deliverable_branches.py to python 3 Depends-On: Ifb435ea9c5d99639e1562761f9c48cbefb9db57f Change-Id: I89942097cb29aeeaafc19f6bf7e849ea6002a7fa Signed-off-by: Doug Hellmann --- .../scripts/release-tools/list_deliverable_branches.py | 8 +++----- jenkins/scripts/release-tools/py3-requirements.txt | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 jenkins/scripts/release-tools/py3-requirements.txt diff --git a/jenkins/scripts/release-tools/list_deliverable_branches.py b/jenkins/scripts/release-tools/list_deliverable_branches.py index d7581a42f9..5e976e94c4 100755 --- a/jenkins/scripts/release-tools/list_deliverable_branches.py +++ b/jenkins/scripts/release-tools/list_deliverable_branches.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -15,8 +15,6 @@ """Lists the branches in the modified deliverable files. """ -from __future__ import print_function - import argparse import os.path import re @@ -35,7 +33,7 @@ def find_modified_deliverable_files(reporoot): results = subprocess.check_output( ['git', 'diff', '--name-only', '--pretty=format:', 'HEAD^'], cwd=reporoot, - ) + ).decode('utf-8') filenames = [ l.strip() for l in results.splitlines() @@ -65,7 +63,7 @@ def get_modified_deliverable_file_content(reporoot, filenames): if not os.path.exists(filename): # The file must have been deleted, skip it. continue - with open(filename, 'r') as f: + with open(filename, 'r', encoding='utf-8') as f: deliverable_data = yaml.load(f.read()) # Map the release version to the release contents so we can diff --git a/jenkins/scripts/release-tools/py3-requirements.txt b/jenkins/scripts/release-tools/py3-requirements.txt new file mode 100644 index 0000000000..48ddf77c62 --- /dev/null +++ b/jenkins/scripts/release-tools/py3-requirements.txt @@ -0,0 +1,5 @@ +pbr>=1.4 +requests>=1.1 +PyYAML>=3.1.0 +zuul +simplejson>=2.2.0