| 455 | print ret_stdout |
| 456 | |
| 457 | def GetTablesDic(output): |
| 458 | lines = output.split("\n") |
| 459 | content_is_started = False |
| 460 | partition_on_tablet = {} |
| 461 | for line in lines: |
| 462 | if line.startswith("---------"): |
| 463 | content_is_started = True |
| 464 | continue |
| 465 | if not content_is_started: |
| 466 | continue |
| 467 | partition = line.split() |
| 468 | if len(partition) < 4: |
| 469 | continue |
| 470 | partitions = partition_on_tablet.get(partition[2], {}) |
| 471 | partitions[partition[3]] = partition |
| 472 | partition_on_tablet[partition[2]] = partitions |
| 473 | return partition_on_tablet |
| 474 | |
| 475 | def BalanceLeader(): |
| 476 | auto_failover_flag = -1 |