Deepcopy port dict in dhcp rpc handler

Added deepcopy of port dict in dhcp rpc handler to prevent operating on
changed dict in case of raising retry request.

Change-Id: Ie1816fe819ba77061e71bd61de2fd9ebe4574cef
Related-Bug: #1494351
This commit is contained in:
Pavel Bondar 2015-10-20 18:59:16 +03:00
parent d598b81f6a
commit a7b976e652
1 changed files with 4 additions and 1 deletions

View File

@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
import itertools
import operator
@ -195,7 +196,9 @@ class DhcpRpcCallback(object):
"""
host = kwargs.get('host')
port = kwargs.get('port')
# Note(pbondar): Create deep copy of port to prevent operating
# on changed dict if RetryRequest is raised
port = copy.deepcopy(kwargs.get('port'))
LOG.debug('Create dhcp port %(port)s '
'from %(host)s.',
{'port': port,