From 66db09139155d755f5d879d41bb61d8ce48ecefe Mon Sep 17 00:00:00 2001 From: Cory Johns Date: Mon, 3 Apr 2017 17:26:47 -0400 Subject: [PATCH] Support placement lists (#103) --- juju/placement.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/juju/placement.py b/juju/placement.py index 5ee9ba6..d0d42f7 100644 --- a/juju/placement.py +++ b/juju/placement.py @@ -22,7 +22,13 @@ def parse(directive): # Handle null case return None - if type(directive) in [dict, client.Placement]: + if isinstance(directive, (list, tuple)): + results = [] + for d in directive: + results.extend(parse(d)) + return results + + if isinstance(directive, (dict, client.Placement)): # We've been handed something that we can simply hand back to # the api. (Forwards compatibility) return [directive] -- 2.25.1