mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-30 19:43:47 +00:00 
			
		
		
		
	Make all scripts in scripts/ pass mypy check.
This commit is contained in:
		| @@ -34,9 +34,10 @@ parser.add_option('--min-threshold', | ||||
|  | ||||
| (options, args) = parser.parse_args() | ||||
|  | ||||
| output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_consumers'], shell=False) | ||||
| output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_consumers'], | ||||
|                                  universal_newlines=True) | ||||
|  | ||||
| consumers = defaultdict(int) | ||||
| consumers = defaultdict(int) # type: Dict[str, int] | ||||
|  | ||||
| for line in output.split('\n'): | ||||
|     parts = line.split('\t') | ||||
|   | ||||
| @@ -23,7 +23,7 @@ states = { | ||||
|     3: "UNKNOWN" | ||||
| } | ||||
|  | ||||
| re = re.compile(r'(\w+)\t(\d+)') | ||||
| pattern = re.compile(r'(\w+)\t(\d+)') | ||||
| output = subprocess.check_output(['/usr/sbin/rabbitmqctl', 'list_queues'], shell=False) | ||||
|  | ||||
| status = 0 | ||||
| @@ -35,7 +35,7 @@ if 'USER' in os.environ and not os.environ['USER'] in ['root', 'rabbitmq']: | ||||
|  | ||||
| for line in output.split("\n"): | ||||
|     line = line.strip() | ||||
|     m = re.match(line) | ||||
|     m = pattern.match(line) | ||||
|     if m: | ||||
|         queue = m.group(1) | ||||
|         count = int(m.group(2)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user