Pick the first container

Rather than inefficiently looping through all the containers that a
service has and overriding each volumes_from value, pick the first
one and return that.

Signed-off-by: Mazz Mosley <mazz@houseofmnowster.com>
This commit is contained in:
Mazz Mosley 2015-10-06 13:11:49 +01:00
commit f9028703f4
3 changed files with 6 additions and 5 deletions

View file

@ -211,7 +211,7 @@ class ProjectTest(unittest.TestCase):
'volumes_from': ['vol']
}
], None)
self.assertEqual(project.get_service('test')._get_volumes_from(), [cid + ':rw' for cid in container_ids])
self.assertEqual(project.get_service('test')._get_volumes_from(), [container_ids[0] + ':rw'])
def test_net_unset(self):
project = Project.from_dicts('test', [