From 891e4e80e86ff10f4ce38853db9dd03ad0f88c58 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 17 Oct 2020 11:24:22 +0800 Subject: [PATCH] build-integration-branch: change to be pep8 compliant Signed-off-by: Kefu Chai --- src/script/build-integration-branch | 56 +++++++++++++---------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/src/script/build-integration-branch b/src/script/build-integration-branch index 511a950d44b..e0cf9f4544f 100755 --- a/src/script/build-integration-branch +++ b/src/script/build-integration-branch @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """ -Builds integration branches. Something similar to +Builds integration branches. Something similar to $ git checkout -b branch-name $ for b in $(get-branches-from-github) ; do > git pull b @@ -19,56 +19,50 @@ Options: --no-date Don't add `{postfix}` to the branch name. """ -from __future__ import print_function - import json import os import requests -from subprocess import call, check_output import sys import time -try: - from urllib.parse import urljoin -except: - from urlparse import urljoin + +from subprocess import call, check_output +from urllib.parse import urljoin TIME_FORMAT = '%Y-%m-%d-%H%M' postfix = "-" + time.strftime(TIME_FORMAT, time.localtime()) -current_branch = check_output('git rev-parse --abbrev-ref HEAD', shell=True).strip().decode() +current_branch = check_output('git rev-parse --abbrev-ref HEAD', + shell=True).strip().decode() if current_branch in 'mimic nautilus octopus pacific'.split(): - postfix += '-' + current_branch - print(f"Adding current branch name '-{current_branch}' as a postfix") + postfix += '-' + current_branch + print(f"Adding current branch name '-{current_branch}' as a postfix") repo = "ceph/ceph" try: - from docopt import docopt - arguments = docopt(__doc__.format(postfix=postfix)) - label = arguments['