Skip to content

Commit 1fd5851

Browse files
authored
Deprecate xen from SDKs and Tools (#648)
* Deprecate `xen` from SDKs and Tools
1 parent 5302e71 commit 1fd5851

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

linode_api4/objects/linode.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import copy
22
import string
33
import sys
4+
import warnings
45
from dataclasses import dataclass, field
56
from datetime import datetime
67
from enum import Enum
@@ -217,7 +218,7 @@ def resize(self, new_size):
217218
class Kernel(Base):
218219
"""
219220
The primary component of every Linux system. The kernel interfaces
220-
with the system’s hardware and it controls the operating system’s core functionality.
221+
with the system’s hardware, and it controls the operating system’s core functionality.
221222
222223
Your Compute Instance is capable of running one of three kinds of kernels:
223224
@@ -237,6 +238,10 @@ class Kernel(Base):
237238
to compile the kernel from source than to download it from your package manager. For more
238239
information on custom compiled kernels, review our guides for Debian, Ubuntu, and CentOS.
239240
241+
.. note::
242+
The ``xen`` property is deprecated and is no longer returned by the API.
243+
It is maintained for backward compatibility only.
244+
240245
API Documentation: https://techdocs.akamai.com/linode-api/reference/get-kernel
241246
"""
242247

@@ -256,6 +261,16 @@ class Kernel(Base):
256261
"pvops": Property(),
257262
}
258263

264+
def __getattribute__(self, name: str) -> object:
265+
if name == "xen":
266+
warnings.warn(
267+
"The 'xen' property of Kernel is deprecated and is no longer "
268+
"returned by the API. It is maintained for backward compatibility only.",
269+
DeprecationWarning,
270+
stacklevel=2,
271+
)
272+
return super().__getattribute__(name)
273+
259274

260275
class Type(Base):
261276
"""

0 commit comments

Comments
 (0)