File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11import copy
22import string
33import sys
4+ import warnings
45from dataclasses import dataclass , field
56from datetime import datetime
67from enum import Enum
@@ -255,11 +256,21 @@ class Kernel(Base):
255256 "updates" : Property (),
256257 "version" : Property (),
257258 "architecture" : Property (),
258- "xen" : Property (), # deprecated and not returned by the API anymore, but left here for backward compatibility
259+ "xen" : Property (),
259260 "built" : Property (),
260261 "pvops" : Property (),
261262 }
262263
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+
263274
264275class Type (Base ):
265276 """
You can’t perform that action at this time.
0 commit comments