Yuvipanda has submitted this change and it was merged.
Change subject: Add feature to ignore databases with a particular regex
......................................................................
Add feature to ignore databases with a particular regex
Change-Id: I924f60528fbdf6dc3e3695ce2c1dc47e6d9e88c5
---
M auditor/run.py
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Yuvipanda: Verified; Looks good to me, approved
diff --git a/auditor/run.py b/auditor/run.py
index a7a688b..104854d 100644
--- a/auditor/run.py
+++ b/auditor/run.py
@@ -1,6 +1,7 @@
import argparse
import MySQLdb
import yaml
+import re
from dbreflector import DBReflector
from mwconfig import MWConfig
@@ -15,6 +16,8 @@
argparser.add_argument('--expectedconfig', help='Path to yaml file listing
expected table config')
argparser.add_argument('--db_suffix', help='Suffix to use for each database
name',
default='')
+argparser.add_argument('--ignore-db-pattern', help='DBs with names matching
this regex will be ignored',
+ default=None)
args = argparser.parse_args()
@@ -39,6 +42,8 @@
reflector = DBReflector(conn)
dbnames = reflector.get_databases()
for dbname in dbnames:
+ if args.ignore_db_pattern and re.match(args.ignore_db_pattern, dbname):
+ continue
all_dbs.add(dbname)
if dbname not in whitelist_dbs:
continue
--
To view, visit https://gerrit.wikimedia.org/r/180110
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I924f60528fbdf6dc3e3695ce2c1dc47e6d9e88c5
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/labsdb-auditor
Gerrit-Branch: master
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits