Kami commented on a change in pull request #1477:
URL: https://github.com/apache/libcloud/pull/1477#discussion_r464069228



##########
File path: libcloud/compute/drivers/kubevirt.py
##########
@@ -181,7 +186,8 @@ def destroy_node(self, node):
     # only has container disk support atm with no persistency
     def create_node(self, name, image, location=None, ex_memory=128, ex_cpu=1,
                     ex_disks=None, ex_network=None,
-                    ex_termination_grace_period=0):
+                    ex_termination_grace_period=0,
+                    ports={}):

Review comment:
       Please don't use mutable defaults - 
https://florimond.dev/blog/articles/2018/08/python-mutable-defaults-are-the-source-of-all-evil/#:~:text=In%20Python%2C%20when%20passing%20a,or%20even%20a%20class%20instance.
   
   Doing ``ports=None`` and then inside method ``ports = ports or {}`` is 
better and safer.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to