From 064d7816071695f08b2b8fe5e43dbedd7963e301 Mon Sep 17 00:00:00 2001 From: Swapnil Date: Tue, 25 Jun 2024 13:25:53 +0530 Subject: [PATCH] Create function to create note data --- agent.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/agent.py b/agent.py index 978ec7a..5aa776a 100644 --- a/agent.py +++ b/agent.py @@ -161,6 +161,13 @@ class ServerData: logging.info("Post data created") return post_data + def create_note_data(self, server_id): + note_data = { + 'service_id': server_id, + 'note': 'Bla bla bla' + } + return note_data + class ServerManager: def __init__(self, host, api_key): @@ -249,10 +256,7 @@ def main(): logging.info('Server does not exist, Creating...') logging.info(server_manager.create_server(post_data)) - note_data = { - 'service_id': server_id, - 'note': 'Bla bla bla' - } + note_data = server_data.create_note_data(server_id) try: note = server_manager.get_note(server_id) except urllib.error.HTTPError: