Implemented key categorization to distinguish between keys set only during server creation and those that can be updated

This commit is contained in:
Shailaja Kumari 2024-06-13 16:15:24 +05:30
parent 0072a07754
commit bbb59e8519
Signed by: shailaja
GPG Key ID: 2B9455CAFBC4D75A

View File

@ -110,7 +110,7 @@ class ServerManager:
def update_server(self, post_data, server_id):
# remove following keys from post_data
for key in ['ssh_port', 'ip1', 'currency', 'price', 'payment_term', 'next_due_date']:
for key in ['ssh_port', 'provider_id', 'location_id', 'currency', 'price', 'payment_term', 'next_due_date']:
post_data.pop(key, None)
logging.info(f"Updating server with id {server_id}...")
return self.send_request('PUT', '/api/servers/' + str(server_id), post_data)