Show More
@@ -476,16 +476,24 b' def vcs_backends():' | |||
|
476 | 476 | |
|
477 | 477 | def vcs_server(): |
|
478 | 478 | import rhodecode |
|
479 |
from rhodecode.lib.vcs.backends import get_vcsserver_ |
|
|
479 | from rhodecode.lib.vcs.backends import get_vcsserver_service_data | |
|
480 | 480 | |
|
481 | 481 | server_url = rhodecode.CONFIG.get('vcs.server') |
|
482 | 482 | enabled = rhodecode.CONFIG.get('vcs.server.enable') |
|
483 | 483 | protocol = rhodecode.CONFIG.get('vcs.server.protocol') or 'http' |
|
484 | 484 | state = STATE_OK_DEFAULT |
|
485 | 485 | version = None |
|
486 | workers = 0 | |
|
486 | 487 | |
|
487 | 488 | try: |
|
488 |
|
|
|
489 | data = get_vcsserver_service_data() | |
|
490 | if data and 'version' in data: | |
|
491 | version = data['version'] | |
|
492 | ||
|
493 | if data and 'config' in data: | |
|
494 | conf = data['config'] | |
|
495 | workers = conf.get('workers', '?') | |
|
496 | ||
|
489 | 497 | connection = 'connected' |
|
490 | 498 | except Exception as e: |
|
491 | 499 | connection = 'failed' |
@@ -502,8 +510,9 b' def vcs_server():' | |||
|
502 | 510 | |
|
503 | 511 | human_value = value.copy() |
|
504 | 512 | human_value['text'] = \ |
|
505 | '{url}@ver:{ver} via {mode} mode, connection:{conn}'.format( | |
|
506 |
url=server_url, ver=version, mode=protocol, |
|
|
513 | '{url}@ver:{ver} via {mode} mode[workers:{workers}], connection:{conn}'.format( | |
|
514 | url=server_url, ver=version, workers=workers, mode=protocol, | |
|
515 | conn=connection) | |
|
507 | 516 | |
|
508 | 517 | return SysInfoRes(value=value, state=state, human_value=human_value) |
|
509 | 518 | |
@@ -526,12 +535,12 b' def rhodecode_app_info():' | |||
|
526 | 535 | |
|
527 | 536 | def rhodecode_config(): |
|
528 | 537 | import rhodecode |
|
529 | import ConfigParser | |
|
538 | import ConfigParser as configparser | |
|
530 | 539 | path = rhodecode.CONFIG.get('__file__') |
|
531 | 540 | rhodecode_ini_safe = rhodecode.CONFIG.copy() |
|
532 | 541 | |
|
533 | 542 | try: |
|
534 |
config = |
|
|
543 | config = configparser.ConfigParser() | |
|
535 | 544 | config.read(path) |
|
536 | 545 | parsed_ini = config |
|
537 | 546 | if parsed_ini.has_section('server:main'): |
@@ -89,10 +89,7 b' def get_supported_backends():' | |||
|
89 | 89 | return settings.BACKENDS.keys() |
|
90 | 90 | |
|
91 | 91 | |
|
92 |
def get_vcsserver_ |
|
|
92 | def get_vcsserver_service_data(): | |
|
93 | 93 | from rhodecode.lib.vcs import connection |
|
94 |
|
|
|
95 | if data and 'version' in data: | |
|
96 | return data['version'] | |
|
94 | return connection.Service.get_vcsserver_service_data() | |
|
97 | 95 | |
|
98 | return None |
General Comments 0
You need to be logged in to leave comments.
Login now