def call_scout(kubectl_version, kube_cluster_version, operation, method):
config_root = Path.home() / ".config" / "telepresence"
config_root.mkdir(parents=True, exist_ok=True)
id_file = config_root / 'id'
scout_kwargs = dict(
kubectl_version=kubectl_version,
kubernetes_version=kube_cluster_version,
operation=operation,
method=method
)
try:
with id_file.open('x') as f:
install_id = str(uuid4())
f.write(install_id)
scout_kwargs["new_install"] = True
except FileExistsError:
with id_file.open('r') as f:
install_id = f.read()
scout_kwargs["new_install"] = False
scout = Scout("telepresence", __version__, install_id)
return scout.report(**scout_kwargs)
评论列表
文章目录