Skip to content

Commit

Permalink
move deprecation warning ro correct place
Browse files Browse the repository at this point in the history
  • Loading branch information
odelame committed Aug 1, 2024
1 parent 1cbc93e commit 3f46ea0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 0 additions & 8 deletions granulate_utils/linux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,3 @@ def get_kernel_release() -> Tuple[int, int]:

# TASK_COMM_LEN is 16, and it is always null-terminated, so 15.
COMM_PATTERN = r".{0,15}"

import warnings

warnings.warn(
"granulate_utils.linux.cgroups is deprecated, use granulate_utils.linux.cgroups_v2 instead",
DeprecationWarning,
stacklevel=2,
)
8 changes: 8 additions & 0 deletions granulate_utils/linux/cgroups_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# limitations under the License.
#

import warnings

from granulate_utils.linux.cgroups_v2.base_controller import BaseController # noqa: F401
from granulate_utils.linux.cgroups_v2.cgroup import get_process_cgroups # noqa: F401
from granulate_utils.linux.cgroups_v2.cpu_controller import CpuController, CpuControllerFactory # noqa: F401
Expand All @@ -23,3 +25,9 @@
SystemdLegacyController,
SystemdUnifiedController,
)

warnings.warn(
"granulate_utils.linux.cgroups is deprecated, use granulate_utils.linux.cgroups_v2 instead",
DeprecationWarning,
stacklevel=2,
)

0 comments on commit 3f46ea0

Please sign in to comment.