provision_xmldoc_res) as_conn.set_policykey(policykey) storage.update_keyvalue("X-MS-PolicyKey", policykey) storage.update_keyvalue("EASPolicies", repr(policydict)) if do_apply_eas_policies(policydict): provision_xmldoc_req = Provision.build(policykey) provision_xmldoc_res = as_request("Provision", provision_xmldoc_req) status, policystatus, policykey, policytype, policydict, settings_status = Provision.parse( provision_xmldoc_res) if status == "1": as_conn.set_policykey(policykey) storage.update_keyvalue("X-MS-PolicyKey", policykey) #FolderSync + Provision foldersync_xmldoc_req = FolderSync.build(storage.get_synckey("0")) foldersync_xmldoc_res = as_request("FolderSync", foldersync_xmldoc_req) changes, synckey, status = FolderSync.parse(foldersync_xmldoc_res) if int(status) > 138 and int(status) < 145: print as_status("FolderSync", status) do_provision() foldersync_xmldoc_res = as_request("FolderSync", foldersync_xmldoc_req) changes, synckey, status = FolderSync.parse(foldersync_xmldoc_res) if int(status) > 138 and int(status) < 145: print as_status("FolderSync", status) raise Exception( "Unresolvable provisoning error: %s. Cannot continue..." % status) if len(changes) > 0: storage.update_folderhierarchy(changes) storage.update_synckey(synckey, "0", curs) conn.commit()
as_conn.set_policykey("0") provision_xmldoc_res = as_request("Provision", provision_xmldoc_req) status, policystatus, policykey, policytype, policydict, settings_status = Provision.parse(provision_xmldoc_res) as_conn.set_policykey(policykey) storage.update_keyvalue("X-MS-PolicyKey", policykey) storage.update_keyvalue("EASPolicies", repr(policydict)) if do_apply_eas_policies(policydict): provision_xmldoc_req = Provision.build(policykey) provision_xmldoc_res = as_request("Provision", provision_xmldoc_req) status, policystatus, policykey, policytype, policydict, settings_status = Provision.parse(provision_xmldoc_res) if status == "1": as_conn.set_policykey(policykey) storage.update_keyvalue("X-MS-PolicyKey", policykey) #FolderSync + Provision foldersync_xmldoc_req = FolderSync.build(storage.get_synckey("0")) foldersync_xmldoc_res = as_request("FolderSync", foldersync_xmldoc_req) changes, synckey, status = FolderSync.parse(foldersync_xmldoc_res) if int(status) > 138 and int(status) < 145: print as_status("FolderSync", status) do_provision() foldersync_xmldoc_res = as_request("FolderSync", foldersync_xmldoc_req) changes, synckey, status = FolderSync.parse(foldersync_xmldoc_res) if int(status) > 138 and int(status) < 145: print as_status("FolderSync", status) raise Exception("Unresolvable provisoning error: %s. Cannot continue..." % status) if len(changes) > 0: storage.update_folderhierarchy(changes) storage.update_synckey(synckey, "0", curs) conn.commit()
as_conn.set_policykey("0") provision_xmldoc_res = as_request("Provision", provision_xmldoc_req) status, policystatus, policykey, policytype, policydict, settings_status = Provision.parse(provision_xmldoc_res) as_conn.set_policykey(policykey) storage.update_keyvalue("X-MS-PolicyKey", policykey) storage.update_keyvalue("EASPolicies", repr(policydict)) if do_apply_eas_policies(policydict): provision_xmldoc_req = Provision.build(policykey) provision_xmldoc_res = as_request("Provision", provision_xmldoc_req) status, policystatus, policykey, policytype, policydict, settings_status = Provision.parse(provision_xmldoc_res) if status == "1": as_conn.set_policykey(policykey) storage.update_keyvalue("X-MS-PolicyKey", policykey) #FolderSync + Provision foldersync_xmldoc_req = FolderSync.build(storage.get_synckey("0")) foldersync_xmldoc_res = as_request("FolderSync", foldersync_xmldoc_req) changes, synckey, status = FolderSync.parse(foldersync_xmldoc_res) if int(status) > 138 and int(status) < 145: print (as_status("FolderSync", status)) do_provision() foldersync_xmldoc_res = as_request("FolderSync", foldersync_xmldoc_req) changes, synckey, status = FolderSync.parse(foldersync_xmldoc_res) if int(status) > 138 and int(status) < 145: print (as_status("FolderSync", status)) raise Exception("Unresolvable provisoning error: %s. Cannot continue..." % status) if len(changes) > 0: storage.update_folderhierarchy(changes) storage.update_synckey(synckey, "0", curs) conn.commit()