11import copy
22import string
33import sys
4+ import warnings
45from dataclasses import dataclass , field
56from datetime import datetime
67from enum import Enum
@@ -217,7 +218,7 @@ def resize(self, new_size):
217218class 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
260275class Type (Base ):
261276 """
@@ -800,9 +815,7 @@ class Instance(Base):
800815 "lke_cluster_id" : Property (),
801816 "capabilities" : Property (unordered = True ),
802817 "interface_generation" : Property (),
803- "maintenance_policy" : Property (
804- mutable = True
805- ), # Note: This field is only available when using v4beta.
818+ "maintenance_policy" : Property (mutable = True ),
806819 "locks" : Property (unordered = True ),
807820 }
808821
0 commit comments