From: Pete Vander Giessen Date: Mon, 28 Nov 2016 21:39:31 +0000 (-0500) Subject: Added deprecation notice, and a bit of forwards compatibilty. X-Git-Tag: 0.1.0~29^2~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=d703653028e7ea25da20f205b9ff341c75694e33;p=osm%2FN2VC.git Added deprecation notice, and a bit of forwards compatibilty. --- diff --git a/juju/constraints.py b/juju/constraints.py index 43a80a3..43c048a 100644 --- a/juju/constraints.py +++ b/juju/constraints.py @@ -11,6 +11,9 @@ # constraints keys are valid, and that we can successfully dump the # constraints dict to json. # +# Once https://bugs.launchpad.net/juju/+bug/1645402 is addressed, this +# module should be deprecated. +# import re @@ -34,6 +37,10 @@ def parse(constraints): if constraints is None: return None + if type(constraints) is dict: + # Fowards compatibilty: already parsed + return constraints + constraints = { normalize_key(k): normalize_value(v) for k, v in [ s.split("=") for s in constraints.split(" ")]}