Skip to content

Commit c5f2bac

Browse files
committed
Introduce a way on the connection to check the client version
1 parent 7716314 commit c5f2bac

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

juju/client/connection.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,12 @@ def username(self):
360360
return None
361361
return self.usertag[len('user-'):]
362362

363+
@property
364+
def is_using_old_client(self):
365+
if self.info is None:
366+
raise errors.JujuError("Not connected yet.")
367+
return self.info['server-version'].startswith('2.')
368+
363369
@property
364370
def is_open(self):
365371
return self.monitor.status == Monitor.CONNECTED

0 commit comments

Comments
 (0)