Merge "Use relative imports."
This commit is contained in:
commit
7e3766a8fc
@ -5,7 +5,7 @@ import json
|
|||||||
import requests
|
import requests
|
||||||
import termcolor
|
import termcolor
|
||||||
|
|
||||||
import bionicbb.gerrit
|
import gerrit
|
||||||
|
|
||||||
from flask import Flask, request
|
from flask import Flask, request
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@ -79,7 +79,7 @@ def drop_rejection():
|
|||||||
patch_set = revision_info['patchset']
|
patch_set = revision_info['patchset']
|
||||||
|
|
||||||
bb_email = 'bionicbb@android.com'
|
bb_email = 'bionicbb@android.com'
|
||||||
labels = bionicbb.gerrit.get_labels(change_id, patch_set)
|
labels = gerrit.get_labels(change_id, patch_set)
|
||||||
if bb_email in labels['Verified']:
|
if bb_email in labels['Verified']:
|
||||||
bb_review = labels['Verified'][bb_email]
|
bb_review = labels['Verified'][bb_email]
|
||||||
else:
|
else:
|
||||||
|
@ -15,8 +15,8 @@ import time
|
|||||||
|
|
||||||
import apiclient.errors
|
import apiclient.errors
|
||||||
|
|
||||||
import bionicbb.config
|
import config
|
||||||
import bionicbb.gerrit
|
import gerrit
|
||||||
|
|
||||||
|
|
||||||
class GmailError(RuntimeError):
|
class GmailError(RuntimeError):
|
||||||
@ -48,8 +48,7 @@ def build_service():
|
|||||||
STORAGE = Storage('oauth.storage')
|
STORAGE = Storage('oauth.storage')
|
||||||
|
|
||||||
# Start the OAuth flow to retrieve credentials
|
# Start the OAuth flow to retrieve credentials
|
||||||
flow = flow_from_clientsecrets(bionicbb.config.client_secret_file,
|
flow = flow_from_clientsecrets(config.client_secret_file, scope=OAUTH_SCOPE)
|
||||||
scope=OAUTH_SCOPE)
|
|
||||||
http = httplib2.Http()
|
http = httplib2.Http()
|
||||||
|
|
||||||
# Try to retrieve credentials from storage or run the flow to generate them
|
# Try to retrieve credentials from storage or run the flow to generate them
|
||||||
@ -92,9 +91,9 @@ def get_gerrit_info(body):
|
|||||||
|
|
||||||
|
|
||||||
def clean_project(gerrit_info, dry_run):
|
def clean_project(gerrit_info, dry_run):
|
||||||
username = bionicbb.config.jenkins_credentials['username']
|
username = config.jenkins_credentials['username']
|
||||||
password = bionicbb.config.jenkins_credentials['password']
|
password = config.jenkins_credentials['password']
|
||||||
jenkins_url = bionicbb.config.jenkins_url
|
jenkins_url = config.jenkins_url
|
||||||
jenkins = jenkinsapi.api.Jenkins(jenkins_url, username, password)
|
jenkins = jenkinsapi.api.Jenkins(jenkins_url, username, password)
|
||||||
|
|
||||||
build = 'clean-bionic-presubmit'
|
build = 'clean-bionic-presubmit'
|
||||||
@ -127,9 +126,9 @@ def build_project(gerrit_info, dry_run):
|
|||||||
'platform/external/compiler-rt': 'bionic-presubmit',
|
'platform/external/compiler-rt': 'bionic-presubmit',
|
||||||
}
|
}
|
||||||
|
|
||||||
username = bionicbb.config.jenkins_credentials['username']
|
username = config.jenkins_credentials['username']
|
||||||
password = bionicbb.config.jenkins_credentials['password']
|
password = config.jenkins_credentials['password']
|
||||||
jenkins_url = bionicbb.config.jenkins_url
|
jenkins_url = config.jenkins_url
|
||||||
jenkins = jenkinsapi.api.Jenkins(jenkins_url, username, password)
|
jenkins = jenkinsapi.api.Jenkins(jenkins_url, username, password)
|
||||||
|
|
||||||
project = gerrit_info['Project']
|
project = gerrit_info['Project']
|
||||||
@ -151,8 +150,8 @@ def build_project(gerrit_info, dry_run):
|
|||||||
project_path)
|
project_path)
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
ref = bionicbb.gerrit.ref_for_change(change_id)
|
ref = gerrit.ref_for_change(change_id)
|
||||||
except bionicbb.gerrit.GerritError as ex:
|
except gerrit.GerritError as ex:
|
||||||
print '{}({}): {} {}'.format(
|
print '{}({}): {} {}'.format(
|
||||||
termcolor.colored('GERRIT-ERROR', 'red'),
|
termcolor.colored('GERRIT-ERROR', 'red'),
|
||||||
ex.code,
|
ex.code,
|
||||||
@ -197,7 +196,7 @@ def drop_rejection(gerrit_info, dry_run):
|
|||||||
'changeid': gerrit_info['Change-Id'],
|
'changeid': gerrit_info['Change-Id'],
|
||||||
'patchset': gerrit_info['PatchSet']
|
'patchset': gerrit_info['PatchSet']
|
||||||
}
|
}
|
||||||
url = '{}/{}'.format(bionicbb.config.build_listener_url, 'drop-rejection')
|
url = '{}/{}'.format(config.build_listener_url, 'drop-rejection')
|
||||||
headers = {'Content-Type': 'application/json;charset=UTF-8'}
|
headers = {'Content-Type': 'application/json;charset=UTF-8'}
|
||||||
if not dry_run:
|
if not dry_run:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user