From 7bba229838354b472d7fdd735a01f0e223a89750 Mon Sep 17 00:00:00 2001 From: Joshua Conner Date: Mon, 17 Mar 2014 18:16:06 -0700 Subject: [PATCH] docker bugfixes: trim whitespace around list param elements, handle list params being coerced to int or long type --- library/cloud/docker | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/cloud/docker b/library/cloud/docker index 0248f5992a..f043e11c4c 100644 --- a/library/cloud/docker +++ b/library/cloud/docker @@ -395,8 +395,10 @@ class DockerManager: """ param_list = self.module.params.get(param_name) if not isinstance(param_list, list): - param_list = param_list.split(delimiter) - return param_list + # if param_list is a number, like 3333, this will fail, so we coerce to a str first + param_list = str(param_list).split(delimiter) + # whitespace in between commas will cause problems if we don't strip each param + return [param.strip() for param in param_list] def get_exposed_ports(self, expose_list):