Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-26292

Nutanix template, validating input params

XMLWordPrintable

    • Icon: Problem report Problem report
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 7.0.11, 7.2.5
    • Templates (T)
    • None

      Throughout the template, there is a code snippet used to validate input parameters for "Script" item:

      var Nutanix = {
                      params: {},
                  
                      setParams: function (requiredParams, allParams) {
                          requiredParams.forEach(function (field) {
                              if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
                                  throw 'Required param is not set: ' + field + '.';
                              }
                          });
                  
                          Nutanix.params = params;
                      },

      It's unclear how the function "setParams" can report "params" back.

      The line seems incorrect:

      Nutanix.params = params;

      Because "params" seems to be an empty object.

            akotsegubov Aleksandr Kotsegubov
            aigars.kadikis Aigars Kadikis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: