From 4139a215c947d187f2c30004088cfe58d294c6fb Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 12 May 2016 08:53:13 -0400 Subject: [PATCH] Add nominal support for Untangle v12 (which is the same as v11). --- doc/man8/untangle-https-backup.8 | 6 +++--- src/untangle/untangle.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/man8/untangle-https-backup.8 b/doc/man8/untangle-https-backup.8 index 488cb1e..419112e 100644 --- a/doc/man8/untangle-https-backup.8 +++ b/doc/man8/untangle-https-backup.8 @@ -41,9 +41,9 @@ The hostname or IP address where the Untangle web UI is available. The Untangle admin username. .IP \fBpassword\fR\ (required) The Untangle admin password. -.IP \fBversion\fR\ (default:\ \fI11\fR) -The version of Untangle running on this host. Currently only \fI9\fR -and \fI11\fR are supported. +.IP \fBversion\fR\ (default:\ \fI12\fR) +The version of Untangle running on this host. Currently only \fI9\fR, +\fI11\fR, and \fI12\fR are supported. .IP \fBverify_cert\fR\ (default:\ False) Whether or not to verify the site's SSL certificate, either \fITrue\fR or \fIFalse\fR. diff --git a/src/untangle/untangle.py b/src/untangle/untangle.py index 6a97280..f8fd795 100644 --- a/src/untangle/untangle.py +++ b/src/untangle/untangle.py @@ -18,7 +18,7 @@ class Untangle: self.host = s['host'] self.username = s.get('username', 'admin') self.password = s['password'] - self.version = int(s.get('version', '11')) + self.version = int(s.get('version', '12')) self.base_url = 'https://' + self.host + '/' # This never changes # Sanity check the numerical version. @@ -81,6 +81,9 @@ class Untangle: return self.get_backup_v9() elif self.version == 11: return self.get_backup_v11() + elif self.version == 12: + # The procedure for v12 is the same as for v11. + return self.get_backup_v11() def get_backup_v9(self): -- 2.44.2