11from __future__ import annotations
22
3- import warnings
43from datetime import datetime
54from typing import TYPE_CHECKING , Any , NamedTuple
65
@@ -1006,9 +1005,9 @@ def rebuild(
10061005 self ,
10071006 server : Server | BoundServer ,
10081007 image : Image | BoundImage ,
1009- * ,
1010- return_response : bool = False ,
1011- ) -> RebuildResponse | BoundAction :
1008+ # pylint: disable=unused-argument
1009+ ** kwargs : Any ,
1010+ ) -> RebuildResponse :
10121011 """Rebuilds a server overwriting its disk with the content of an image, thereby destroying all data on the target server.
10131012
10141013 :param server: Server to rebuild
@@ -1022,22 +1021,11 @@ def rebuild(
10221021 json = data ,
10231022 )
10241023
1025- rebuild_response = RebuildResponse (
1024+ return RebuildResponse (
10261025 action = BoundAction (self ._client .actions , response ["action" ]),
10271026 root_password = response .get ("root_password" ),
10281027 )
10291028
1030- if not return_response :
1031- warnings .warn (
1032- "Returning only the 'action' is deprecated, please set the "
1033- "'return_response' keyword argument to 'True' to return the full "
1034- "rebuild response and update your code accordingly." ,
1035- DeprecationWarning ,
1036- stacklevel = 2 ,
1037- )
1038- return rebuild_response .action
1039- return rebuild_response
1040-
10411029 def enable_backup (self , server : Server | BoundServer ) -> BoundAction :
10421030 """Enables and configures the automatic daily backup option for the server. Enabling automatic backups will increase the price of the server by 20%.
10431031
0 commit comments