refactor - remove server_id from create_note_data

This commit is contained in:
Swapnil 2024-06-25 15:35:33 +05:30
parent f10d0b53b0
commit c5474b1f3c
Signed by untrusted user: swapnil
GPG Key ID: 58029C48BB100574

View File

@ -163,7 +163,7 @@ class ServerData:
logging.info("Post data created") logging.info("Post data created")
return post_data return post_data
def create_note_data(self, server_id): def create_note_data(self):
chassis_info = None chassis_info = None
for section in self.dmidecode_data: for section in self.dmidecode_data:
if section['DMIType'] == 1: if section['DMIType'] == 1:
@ -183,7 +183,6 @@ class ServerData:
chassis_model, chassis_serial, processor_model, processor_count, '\n'.join(['R1', 'R2', 'R3'])) chassis_model, chassis_serial, processor_model, processor_count, '\n'.join(['R1', 'R2', 'R3']))
note_data = { note_data = {
'service_id': server_id,
'note': note, 'note': note,
} }
return note_data return note_data
@ -298,7 +297,7 @@ def main():
server_id = server_manager.upsert_server(post_data) server_id = server_manager.upsert_server(post_data)
logging.info('Server id: {}'.format(server_id)) logging.info('Server id: {}'.format(server_id))
note_data = server_data.create_note_data(server_id) note_data = server_data.create_note_data()
server_manager.upsert_note(note_data, server_id) server_manager.upsert_note(note_data, server_id)
if __name__ == '__main__': if __name__ == '__main__':