diff --git a/mitel_ommclient2/client.py b/mitel_ommclient2/client.py index eee5543..d71afc6 100644 --- a/mitel_ommclient2/client.py +++ b/mitel_ommclient2/client.py @@ -48,7 +48,8 @@ class OMMClient2: m = messages.Open() m.username = self._username m.password = self._password - m.UserDeviceSyncClient = self._ommsync + if self._ommsync: + m.UserDeviceSyncClient = "true" r = self.connection.request(m) r.raise_on_error() diff --git a/ommcli b/ommcli index 47cc3a7..7113dff 100755 --- a/ommcli +++ b/ommcli @@ -35,18 +35,20 @@ if __name__ == "__main__": connect_parser.add_argument("-n", dest="hostname", default="127.0.0.1") connect_parser.add_argument("-u", dest="username", default="omm") connect_parser.add_argument("-p", dest="password") + connect_parser.add_argument("--ommsync", dest="ommsync", action='store_true', help="Log in with ommsync mode") connect_parser.add_argument("subcommand", nargs="*") args = connect_parser.parse_args() hostname = args.hostname username = args.username password = args.password + ommsync = args.ommsync subcommand = args.subcommand if not password: password = getpass.getpass(prompt="OMM password for {}@{}:".format(username, hostname)) - c = OMMClient2(hostname, username, password) + c = OMMClient2(hostname, username, password, ommsync=ommsync) def encrypt(secret): if rsa is None: