Skip to content

Commit

Permalink
Merge pull request #194 from wayyoungboy/master
Browse files Browse the repository at this point in the history
fix data
  • Loading branch information
Teingi authored May 9, 2024
2 parents 3f77a3c + 99ecb68 commit 3940d13
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion telemetry/telemetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@
from common.tool import DateTimeEncoder
from common.version import get_obdiag_version
import ssl
from stdio import IO

ssl._create_default_https_context = ssl._create_unverified_context
class Telemetry():
def __init__(self):
self.obversion = None
self.ob_connector = None
self.reporter = "obdiag"
self.cluster_info = None
Expand All @@ -41,6 +44,7 @@ def __init__(self):
self.threads = []
self.work_tag = True
self.version = get_obdiag_version()
self.stdio=IO(1)

def set_cluster_conn(self, obcluster):
try:
Expand Down Expand Up @@ -89,7 +93,7 @@ def get_cluster_info(self):
data = cursor.fetchall()
for data_one in data:
data_one["svr_ip"] = ip_mix_by_sha256(data_one["svr_ip"])

self.obversion=version
self.cluster_info = json.dumps(data)
self.cluster_info["obversion"] = version
except Exception as e:
Expand Down Expand Up @@ -150,6 +154,8 @@ def put_data(self):
report_data["cmd_info"] = self.cmd_info
if self.check_info is not None:
report_data["check_info"] = self.check_info
if self.obversion is not None:
report_data["obversion"]=self.obversion

re = {"content": report_data,"component":"obdiag"}

Expand Down

0 comments on commit 3940d13

Please sign in to comment.