We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f45389f commit 54567a1Copy full SHA for 54567a1
1 file changed
juju/model.py
@@ -2012,8 +2012,12 @@ async def get_constraints(self):
2012
:returns: A ``dict`` of constraints.
2013
"""
2014
constraints = {}
2015
- client_facade = client.ModelConfigFacade.from_connection(self.connection())
2016
- result = await client_facade.GetModelConstraints()
+ facade_cls = client.ModelConfigFacade
+ if facade_cls.best_facade_version(self.connection()) <= 2:
2017
+ facade_cls = client.ClientFacade
2018
+
2019
+ facade = facade_cls.from_connection(self.connection())
2020
+ result = await facade.GetModelConstraints()
2021
2022
# GetModelConstraints returns GetConstraintsResults which has a
2023
# 'constraints' attribute. If no constraints have been set
0 commit comments