aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcpettet <rush@wikimedia.org>2014-11-19 21:23:45 -0600
committercpettet <rush@wikimedia.org>2014-11-19 21:23:45 -0600
commitf9ba5228d336d7106fddae36db3b88ce492f0934 (patch)
tree62ace1894b298c4ac5507af1d1ba2983467a3a0c
parent2fd30e97842f405ef975077e3e955df9c495eb76 (diff)
bugzilla scripts should specify user/passwd
-rwxr-xr-xbugzilla_create.py12
-rwxr-xr-xbugzilla_fetch.py10
-rwxr-xr-xbugzilla_populate_user_relations_comments_table.py5
-rwxr-xr-xbugzilla_populate_user_relations_table.py5
-rwxr-xr-xbugzilla_reorder.py4
-rwxr-xr-xbugzilla_update_tasks.py8
6 files changed, 34 insertions, 10 deletions
diff --git a/bugzilla_create.py b/bugzilla_create.py
index 255cd14..a797502 100755
--- a/bugzilla_create.py
+++ b/bugzilla_create.py
@@ -37,7 +37,9 @@ def create(bugid):
phabm = phabmacros('', '', '')
phabm.con = phab
- pmig = phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
current = pmig.sql_x("SELECT priority, \
header, \
@@ -331,7 +333,9 @@ def create(bugid):
def run_create(bugid, tries=1):
if tries == 0:
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
import_priority = pmig.sql_x("SELECT priority \
FROM bugzilla_meta \
WHERE id = %s", (bugid,))
@@ -370,7 +374,9 @@ def main():
else:
priority = 0
- pmig = phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
bugs = return_bug_list(dbcon=pmig, priority=priority)
pmig.close()
diff --git a/bugzilla_fetch.py b/bugzilla_fetch.py
index ad867f1..2ba2d9d 100755
--- a/bugzilla_fetch.py
+++ b/bugzilla_fetch.py
@@ -21,7 +21,10 @@ from wmfphablib import return_bug_list
def fetch(bugid):
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
+
server = xmlrpclib.ServerProxy(config.Bugzilla_url, use_datetime=True)
token_data = server.User.login({'login': config.Bugzilla_login,
'password': config.Bugzilla_password})
@@ -79,7 +82,10 @@ def fetch(bugid):
def run_fetch(bugid, tries=1):
if tries == 0:
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
+
current = pmig.sql_x("SELECT * from bugzilla_meta \
where id = %s", bugid)
if current:
diff --git a/bugzilla_populate_user_relations_comments_table.py b/bugzilla_populate_user_relations_comments_table.py
index 08a2489..b596410 100755
--- a/bugzilla_populate_user_relations_comments_table.py
+++ b/bugzilla_populate_user_relations_comments_table.py
@@ -47,7 +47,10 @@ def populate(bugid):
pmig.sql_x("INSERT INTO user_relations_comments (user, issues, created, modified) VALUES (%s, %s, %s, %s)",
insert_values)
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
+
issue = pmig.sql_x("SELECT id FROM bugzilla_meta WHERE id = %s", bugid)
if not issue:
log('issue %s does not exist for user population' % (bugid,))
diff --git a/bugzilla_populate_user_relations_table.py b/bugzilla_populate_user_relations_table.py
index 04a7248..d7fbaf7 100755
--- a/bugzilla_populate_user_relations_table.py
+++ b/bugzilla_populate_user_relations_table.py
@@ -20,7 +20,10 @@ from wmfphablib import return_bug_list
def populate(bugid):
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
issue = pmig.sql_x("SELECT id FROM bugzilla_meta WHERE id = %s", bugid)
if not issue:
diff --git a/bugzilla_reorder.py b/bugzilla_reorder.py
index 859a428..af2f106 100755
--- a/bugzilla_reorder.py
+++ b/bugzilla_reorder.py
@@ -23,7 +23,9 @@ from wmfphablib import bzlib
from wmfphablib import ipriority
def reorder(first, start, end, placeholder=300001):
- pmig = phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
# range of issues to renumber
issues = range(int(start), int(end) + 1)
first_issue = issues[0]
diff --git a/bugzilla_update_tasks.py b/bugzilla_update_tasks.py
index 4c902bb..08df965 100755
--- a/bugzilla_update_tasks.py
+++ b/bugzilla_update_tasks.py
@@ -16,7 +16,9 @@ from wmfphablib import config
def update(bugid):
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
epriority = pmig.sql_x("SELECT priority from task_relations where id = %s", bugid)
if epriority and epriority[0] == ipriority['update_success']:
@@ -65,7 +67,9 @@ def update(bugid):
def run_update(bugid, tries=1):
if tries == 0:
- pmig = phabdb.phdb(db=config.bzmigrate_db)
+ pmig = phabdb.phdb(db=config.bzmigrate_db,
+ user=config.bzmigrate_user,
+ passwd=config.bzmigrate_passwd)
current = pmig.sql_x("SELECT * from task_relations where id = %s", bugid)
if current:
pmig.sql_x("UPDATE task_relations SET priority=%s, blocks=%s, modified=%s WHERE id = %s",