Skip to content

Commit 054c3e4

Browse files
committed
Deprecate xen from SDKs and Tools
1 parent a2c403d commit 054c3e4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

linode_api4/objects/linode.py

Lines changed: 12 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
@@ -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

264275
class Type(Base):
265276
"""

0 commit comments

Comments
 (0)