From: Kefu Chai Date: Sat, 17 Oct 2020 03:24:22 +0000 (+0800) Subject: build-integration-branch: change to be pep8 compliant X-Git-Tag: v16.1.0~819^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37700%2Fhead;p=ceph.git build-integration-branch: change to be pep8 compliant Signed-off-by: Kefu Chai --- 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['