@cryptotaxi247 / CoPilot / commits / a7a9831f

creating proper velo client for agent deletion now (#214)

taylor_socfortress committed May 14, 2024 at 08:26 UTC a7a9831f64707a3045d76436c968bf99dfe89fba
2 files changed +3 -2
.gitignore
+1
@@ -49,6 +49,7 @@ wheels/
49 *.sqbpro
50 site/
51 backend/file-store/api.config.yaml
52 +backend/data/api.config.yaml
53 unplugin.components.d.ts
54 package-lock.json
55 *.checkpoint
backend/app/agents/velociraptor/services/agents.py
+2 -2
@@ -198,7 +198,7 @@ async def delete_client(client_id: str) -> dict:
198 Returns:
199 dict: A dictionary containing the result of the deletion operation.
200 """
201 - universal_service = UniversalService()
201 + universal_service = await UniversalService.create("Velociraptor")
202 try:
203 query = create_query(
204 f"SELECT collect_client(client_id='server', artifacts=['Server.Utils.DeleteClient'], env=dict(ClientIdList='{client_id}',ReallyDoIt='Y')) FROM scope()",
@@ -219,7 +219,7 @@ async def ensure_client_deleted(client_id: str) -> dict:
219 Returns:
220 dict: The result of the deletion operation.
221 """
222 - universal_service = UniversalService()
222 + universal_service = await UniversalService.create("Velociraptor")
223 try:
224 query = create_query(
225 "SELECT collect_client(client_id='server', artifacts=['Server.Information.Clients'], env=dict()) FROM scope()",