projects
/
osm
/
N2VC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6637bf3
)
Support placement lists (#103)
author
Cory Johns
<johnsca@gmail.com>
Mon, 3 Apr 2017 21:26:47 +0000
(17:26 -0400)
committer
GitHub
<noreply@github.com>
Mon, 3 Apr 2017 21:26:47 +0000
(17:26 -0400)
juju/placement.py
patch
|
blob
|
history
diff --git
a/juju/placement.py
b/juju/placement.py
index
5ee9ba6
..
d0d42f7
100644
(file)
--- 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]