Fix error when there are no docker volumes present yet (#28145)

* Fix error when there are no docker volumes present yet

* fixes suggested by Shippable
This commit is contained in:
UnderwayNYC 2017-10-30 15:53:08 -04:00 committed by ansibot
parent c3564096cd
commit 11faafcbf7

View file

@ -149,6 +149,9 @@ class DockerVolumeManager(object):
except APIError as e:
self.client.fail(text_type(e))
if volumes[u'Volumes'] is None:
return None
for volume in volumes[u'Volumes']:
if volume['Name'] == self.parameters.volume_name:
return volume