Show More
@@ -27,6 +27,7 b' from pyramid.httpexceptions import HTTPF' | |||
|
27 | 27 | from rhodecode.apps._base import BaseAppView |
|
28 | 28 | from rhodecode.lib import helpers as h |
|
29 | 29 | from rhodecode.lib.auth import LoginRequired |
|
30 | from rhodecode.lib.compat import OrderedDict | |
|
30 | 31 | from rhodecode.model.db import UserApiKeys |
|
31 | 32 | |
|
32 | 33 | log = logging.getLogger(__name__) |
@@ -41,18 +42,17 b' class OpsView(BaseAppView):' | |||
|
41 | 42 | return c |
|
42 | 43 | |
|
43 | 44 | def ops_ping(self): |
|
44 |
data = |
|
|
45 |
|
|
|
46 | } | |
|
45 | data = OrderedDict() | |
|
46 | data['instance'] = self.request.registry.settings.get('instance_id') | |
|
47 | ||
|
47 | 48 | if getattr(self.request, 'user'): |
|
48 | 49 | caller_name = 'anonymous' |
|
49 | 50 | if self.request.user.user_id: |
|
50 | 51 | caller_name = self.request.user.username |
|
51 | 52 | |
|
52 | data.update({ | |
|
53 | 'caller_ip': self.request.user.ip_addr, | |
|
54 | 'caller_name': caller_name, | |
|
55 | }) | |
|
53 | data['caller_ip'] = self.request.user.ip_addr | |
|
54 | data['caller_name'] = caller_name | |
|
55 | ||
|
56 | 56 | return {'ok': data} |
|
57 | 57 | |
|
58 | 58 | def ops_error_test(self): |
@@ -94,4 +94,3 b' class OpsView(BaseAppView):' | |||
|
94 | 94 | } |
|
95 | 95 | |
|
96 | 96 | return {'healthcheck': health_spec} |
|
97 |
@@ -89,7 +89,10 b' def set_instance_id(config):' | |||
|
89 | 89 | if instance_id.startswith('*') or not instance_id: |
|
90 | 90 | prefix = instance_id.lstrip('*') |
|
91 | 91 | _platform_id = platform.uname()[1] or 'instance' |
|
92 |
config['instance_id'] = ' |
|
|
92 | config['instance_id'] = '{prefix}uname:{platform}-pid:{pid}'.format( | |
|
93 | prefix=prefix, | |
|
94 | platform=_platform_id, | |
|
95 | pid=os.getpid()) | |
|
93 | 96 | |
|
94 | 97 | |
|
95 | 98 | def get_default_user_id(): |
General Comments 0
You need to be logged in to leave comments.
Login now