X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FNamespaces.py;h=d78d2f6d44ac57182db1a560ef1209342320a218;hb=bd15bb418bf618ff3055fb25c339778d12c1eaef;hp=2bdcbcb3246b289d10cf2dd87141f0384a0b9ebb;hpb=2da2aa12260143bc513b4dff5e2b2ef6755172ab;p=csit.git diff --git a/resources/libraries/python/Namespaces.py b/resources/libraries/python/Namespaces.py index 2bdcbcb324..d78d2f6d44 100644 --- a/resources/libraries/python/Namespaces.py +++ b/resources/libraries/python/Namespaces.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020 Cisco and/or its affiliates. +# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -13,6 +13,8 @@ """Linux namespace utilities library.""" +from copy import deepcopy + from resources.libraries.python.ssh import exec_cmd_no_error, exec_cmd @@ -145,5 +147,6 @@ class Namespaces: Namespaces.delete_namespace(node, namespace) return - for namespace_name in Namespaces.__namespaces: + namespace_copy = deepcopy(Namespaces.__namespaces) + for namespace_name in namespace_copy: Namespaces.delete_namespace(node, namespace_name)