From 0932bfe7f38b203ac986f33e734cfd2f914e799f Mon Sep 17 00:00:00 2001 From: matthew Date: Fri, 3 Dec 2021 07:34:33 -0800 Subject: [PATCH] l4_cxprofile: Fix mutable default arguments Signed-off-by: matthew --- py-json/l4_cxprofile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/py-json/l4_cxprofile.py b/py-json/l4_cxprofile.py index dd6227e8..c029c0e4 100644 --- a/py-json/l4_cxprofile.py +++ b/py-json/l4_cxprofile.py @@ -139,7 +139,9 @@ class L4CXProfile(LFCliBase): self.json_post(req_url, data) # pprint(data) - def create(self, ports=[], sleep_time=.5, debug_=False, suppress_related_commands_=None): + def create(self, ports=None, sleep_time=.5, debug_=False, suppress_related_commands_=None): + if ports is None: + ports = [] cx_post_data = [] for port_name in ports: print("port_name: {} len: {} self.local_realm.name_to_eid(port_name): {}".format(port_name,