Merge "Allow hacking 0.6.0 and fix versions"
This commit is contained in:
commit
6a63c1b91a
@ -45,6 +45,7 @@
|
|||||||
# acl-parameters:
|
# acl-parameters:
|
||||||
# project: OTHER_PROJECT_NAME
|
# project: OTHER_PROJECT_NAME
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import logging
|
import logging
|
||||||
@ -127,14 +128,14 @@ def fetch_config(project, remote_url, repo_path, env={}):
|
|||||||
status = git_command(repo_path, "fetch %s +refs/meta/config:"
|
status = git_command(repo_path, "fetch %s +refs/meta/config:"
|
||||||
"refs/remotes/gerrit-meta/config" % remote_url, env)
|
"refs/remotes/gerrit-meta/config" % remote_url, env)
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print "Failed to fetch refs/meta/config for project: %s" % project
|
print("Failed to fetch refs/meta/config for project: %s" % project)
|
||||||
return False
|
return False
|
||||||
# Because the following fails if executed more than once you should only
|
# Because the following fails if executed more than once you should only
|
||||||
# run fetch_config once in each repo.
|
# run fetch_config once in each repo.
|
||||||
status = git_command(repo_path, "checkout -b config "
|
status = git_command(repo_path, "checkout -b config "
|
||||||
"remotes/gerrit-meta/config")
|
"remotes/gerrit-meta/config")
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print "Failed to checkout config for project: %s" % project
|
print("Failed to checkout config for project: %s" % project)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return True
|
return True
|
||||||
@ -158,14 +159,14 @@ def push_acl_config(project, remote_url, repo_path, gitid, env={}):
|
|||||||
cmd = "commit -a -m'Update project config.' --author='%s'" % gitid
|
cmd = "commit -a -m'Update project config.' --author='%s'" % gitid
|
||||||
status = git_command(repo_path, cmd)
|
status = git_command(repo_path, cmd)
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print "Failed to commit config for project: %s" % project
|
print("Failed to commit config for project: %s" % project)
|
||||||
return False
|
return False
|
||||||
status, out = git_command_output(repo_path,
|
status, out = git_command_output(repo_path,
|
||||||
"push %s HEAD:refs/meta/config" %
|
"push %s HEAD:refs/meta/config" %
|
||||||
remote_url, env)
|
remote_url, env)
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print "Failed to push config for project: %s" % project
|
print("Failed to push config for project: %s" % project)
|
||||||
print out
|
print(out)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -212,7 +213,7 @@ def create_groups_file(project, gerrit, repo_path):
|
|||||||
fp.write("%s\t%s\n" % (uuid, group))
|
fp.write("%s\t%s\n" % (uuid, group))
|
||||||
status = git_command(repo_path, "add groups")
|
status = git_command(repo_path, "add groups")
|
||||||
if status != 0:
|
if status != 0:
|
||||||
print "Failed to add groups file for project: %s" % project
|
print("Failed to add groups file for project: %s" % project)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -224,7 +225,7 @@ def make_ssh_wrapper(gerrit_user, gerrit_key):
|
|||||||
'ssh -i %s -l %s -o "StrictHostKeyChecking no" $@\n' %
|
'ssh -i %s -l %s -o "StrictHostKeyChecking no" $@\n' %
|
||||||
(gerrit_key, gerrit_user))
|
(gerrit_key, gerrit_user))
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
os.chmod(name, 0755)
|
os.chmod(name, 0o755)
|
||||||
return dict(GIT_SSH=name)
|
return dict(GIT_SSH=name)
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
# for example hourly via cron. It takes an optional argument to specify the
|
# for example hourly via cron. It takes an optional argument to specify the
|
||||||
# path to a configuration file.
|
# path to a configuration file.
|
||||||
# -*- encoding: utf-8 -*-
|
# -*- encoding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
|
__author__ = "Chmouel Boudjnah <chmouel@chmouel.com>"
|
||||||
|
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
@ -84,7 +87,7 @@ CONFIG = parse_ini(conffile)
|
|||||||
|
|
||||||
def debug(msg):
|
def debug(msg):
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
print msg
|
print(msg)
|
||||||
|
|
||||||
|
|
||||||
def get_javascript(project=None):
|
def get_javascript(project=None):
|
||||||
@ -110,7 +113,7 @@ def parse_javascript(javascript):
|
|||||||
|
|
||||||
def upload_rss(xml, output_object):
|
def upload_rss(xml, output_object):
|
||||||
if 'swift' not in CONFIG:
|
if 'swift' not in CONFIG:
|
||||||
print xml
|
print(xml)
|
||||||
return
|
return
|
||||||
|
|
||||||
import swiftclient
|
import swiftclient
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
# Documentation is available here:
|
# Documentation is available here:
|
||||||
# https://www.codeaurora.org/xwiki/bin/QAEP/Gerrit
|
# https://www.codeaurora.org/xwiki/bin/QAEP/Gerrit
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import optparse
|
import optparse
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -70,7 +72,7 @@ def CheckCall(command, cwd=None):
|
|||||||
try:
|
try:
|
||||||
process = subprocess.Popen(command, cwd=cwd, stdout=subprocess.PIPE)
|
process = subprocess.Popen(command, cwd=cwd, stdout=subprocess.PIPE)
|
||||||
std_out, std_err = process.communicate()
|
std_out, std_err = process.communicate()
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
raise CheckCallError(command, cwd, e.errno, None)
|
raise CheckCallError(command, cwd, e.errno, None)
|
||||||
if process.returncode:
|
if process.returncode:
|
||||||
raise CheckCallError(command, cwd, process.returncode,
|
raise CheckCallError(command, cwd, process.returncode,
|
||||||
@ -269,7 +271,7 @@ def main():
|
|||||||
# Similarly squash old approvals
|
# Similarly squash old approvals
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
print "Unsupported category: %s" % approval
|
print("Unsupported category: %s" % approval)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
score = approval["value"]
|
score = approval["value"]
|
||||||
|
@ -1 +1 @@
|
|||||||
hacking>=0.5.3,<0.6
|
hacking>=0.5.6,<0.7
|
||||||
|
Loading…
x
Reference in New Issue
Block a user