Merge pull request #1846 from aanand/fix-mem-limit-options

Fix mem_limit and memswap_limit regression
(cherry picked from commit 93cc7e3751)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-08-11 15:59:08 +01:00
commit d0792b49fa
2 changed files with 6 additions and 2 deletions

View file

@ -173,8 +173,8 @@ class ServiceTest(unittest.TestCase):
service = Service(name='foo', image='foo', hostname='name', client=self.mock_client, mem_limit=1000000000, memswap_limit=2000000000)
self.mock_client.containers.return_value = []
opts = service._get_container_create_options({'some': 'overrides'}, 1)
self.assertEqual(opts['memswap_limit'], 2000000000)
self.assertEqual(opts['mem_limit'], 1000000000)
self.assertEqual(opts['host_config']['MemorySwap'], 2000000000)
self.assertEqual(opts['host_config']['Memory'], 1000000000)
def test_log_opt(self):
log_opt = {'address': 'tcp://192.168.0.42:123'}