From: Cory Johns Date: Mon, 3 Apr 2017 21:26:47 +0000 (-0400) Subject: Support placement lists (#103) X-Git-Tag: 0.4.0~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=66db09139155d755f5d879d41bb61d8ce48ecefe;p=osm%2FN2VC.git Support placement lists (#103) --- 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]