From 7209cea893f6a52c06b2d398ac11402677122c63 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 7 Jul 2024 15:38:33 +0800 Subject: [PATCH] Code quality and missing variables --- agent.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agent.py b/agent.py index 862daf8..c6489e9 100644 --- a/agent.py +++ b/agent.py @@ -1,8 +1,8 @@ import os +import urllib.error import urllib.request import logging import json -import http.client import subprocess import re import shutil @@ -499,15 +499,16 @@ def main(): host, api_key = validate_env_vars() - server_data = ServerData() - post_data = server_data.create_post_data() - server_manager = ServerManager(host, api_key) + server_data = ServerData() + os_list = server_manager.get_os_list() + post_data = server_data.create_post_data(os_list) + + server_id = server_manager.upsert_server(post_data) logging.info('Server id: {}'.format(server_id)) - os_list = server_manager.get_os_list() note_data = server_data.create_note_data() server_manager.upsert_note(note_data, server_id)