def set_ntp_servers(self, primary, secondary=None):
        self._logger.debug("Set ntp-servers: primary:%s secondary:%s" % (primary, secondary))
        self.set_config_changed()
        xpath = pandevice.XPATH_DEVICECONFIG_SYSTEM
        xpath61 = pandevice.XPATH_DEVICECONFIG_SYSTEM + "/ntp-servers"
        # Path is different depending on PAN-OS 6.0 vs 6.1
        # Try PAN-OS 6.1 first
        element61 = ""

        # First if primary is None, remove all NTP config
        if primary is None:
            # PAN-OS 6.1 and higher
            self.xapi.delete(xpath61)
            # PAN-OS 6.0 and lower
            self.xapi.delete(xpath + "/ntp-server-1")
            self.xapi.delete(xpath + "/ntp-server-2")
            return

        if primary:
            element61 += "<ntp-servers>" \
                         "<primary-ntp-server>" \
                         "<ntp-server-address>%s</ntp-server-address>" \
                         "</primary-ntp-server>" % (primary,)
        if secondary:
            element61 += "<secondary-ntp-server>" \
                         "<ntp-server-address>%s</ntp-server-address>" \
                         "</secondary-ntp-server>" % (secondary,)
        element61 += "</ntp-servers>"

        try:
            # PAN-OS 6.1 and higher
            self.xapi.edit(xpath61, element61)
            self._logger.debug("Set ntp server for PAN-OS 6.1 or higher")
        except (pan.xapi.PanXapiError, err.PanDeviceXapiError) as e:
            try:
                message = e.msg
            except AttributeError:
                message = e.message
            if message.startswith("Could not get schema node for xpath"):
                # PAN-OS 6.0 and lower
                self._set_ntp_servers_60(primary, secondary=secondary)
                self._logger.debug("Set ntp server for PAN-OS 6.0 or lower")
            else:
                self._logger.debug("Could not set NTP server, unknown PAN-OS version")
                raise e
dataset/ETHPy150Open PaloAltoNetworks/SplunkforPaloAltoNetworks/bin/lib/pandevice/pandevice/base.py/PanDevice.set_ntp_servers/original