Upgrades, add logging to debug the problem with inter-container communication

Change-Id: I4bc91b9c35cc915de435ab2d9a86f46ba5761192
Related-bug: #1349287
This commit is contained in:
Evgeniy L 2014-08-01 18:00:15 +04:00
parent 306a2f7d5e
commit 3b5a6a333d
2 changed files with 14 additions and 1 deletions

View File

@ -512,6 +512,15 @@ class DockerUpgrader(UpgradeEngine):
# Remove -A (add) prefix and use -D (delete) instead
utils.exec_cmd('iptables -t nat -D {0}'.format(rule[2:]))
# NOTE(eli): Run list of rules again,
# it's required to debug the problem
# with inter-container communication
# https://bugs.launchpad.net/fuel/+bug/1349287
utils.exec_cmd('iptables -t nat -S')
utils.exec_cmd('iptables -S')
utils.exec_cmd('cat /etc/sysconfig/iptables')
utils.exec_cmd('cat /etc/sysconfig/iptables.save')
def stop_container(self, container_id):
"""Stop docker container

View File

@ -367,7 +367,11 @@ class TestDockerUpgrader(BaseTestCase):
'--to-destination 172.17.0.7:1'),
mock.call(
'iptables -t nat -D DOCKER -p tcp -m tcp --dport 2 -j DNAT '
'--to-destination 172.17.0.3:2')]
'--to-destination 172.17.0.3:2'),
mock.call('iptables -t nat -S'),
mock.call('iptables -S'),
mock.call('cat /etc/sysconfig/iptables'),
mock.call('cat /etc/sysconfig/iptables.save')]
self.assertEqual(exec_cmd_mock.call_args_list, expected_calls)