From 54143005256c8cccf6ecf10b81f53ccd021b4c0f Mon Sep 17 00:00:00 2001
From: Elsa <zeyugao@outlook.com>
Date: Wed, 9 Apr 2025 08:42:04 +0800
Subject: [PATCH] Simplify get deploy pids

Signed-off-by: Elsa <zeyugao@outlook.com>
---
 podman_compose.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/podman_compose.py b/podman_compose.py
index ca134e3..74a3ad4 100755
--- a/podman_compose.py
+++ b/podman_compose.py
@@ -774,11 +774,7 @@ def container_to_cpu_res_args(cnt, podman_args):
 
     # Handle pids limit from both container level and deploy section
     pids_limit = cnt.get("pids_limit")
-    deploy_pids = None
-
-    # Check for pids in deploy.resources.limits section
-    if "pids" in limits:
-        deploy_pids = limits["pids"]
+    deploy_pids = limits.get("pids")
 
     # Ensure consistency between pids_limit and deploy.resources.limits.pids
     if pids_limit is not None and deploy_pids is not None: