def get_info(self, proto, *_args): info = ServerCore.get_minimal_server_info(self) info.setdefault("server", {})["type"] = "Python/GLib/proxy" #only show more info if we have authenticated #as the user running the proxy server process: if proto and proto.authenticators: sessions = [] for authenticator in proto.authenticators: auth_sessions = authenticator.get_sessions() if auth_sessions: sessions = auth_sessions break if sessions: uid, gid = sessions[:2] if not POSIX or (uid == os.getuid() and gid == os.getgid()): self.reap() i = 0 for p, v in self.processes.items(): d, _ = v info[i] = { "display": d, "live": p.is_alive(), "pid": p.pid, } i += 1 info["proxies"] = len(self.processes) return info
def get_info(self, proto, *_args): info = ServerCore.get_minimal_server_info(self) info.setdefault("server", {})["type"] = "Python/GLib/proxy" #only show more info if we have authenticated #as the user running the proxy server process: if proto and proto.authenticators: sessions = [] for authenticator in proto.authenticators: auth_sessions = authenticator.get_sessions() if auth_sessions: sessions = auth_sessions break if sessions: uid, gid = sessions[:2] if not POSIX or (uid == getuid() and gid == getgid()): self.reap() i = 0 instances = dict(self.instances) instances_info = {} for proxy_instance, v in instances.items(): isprocess, d, _ = v iinfo = { "display": d, "live": proxy_instance.is_alive(), } if isprocess: iinfo.update({ "pid": proxy_instance.pid, }) else: iinfo.update(proxy_instance.get_info()) instances_info[i] = iinfo i += 1 info["instances"] = instances_info info["proxies"] = len(instances) return info