Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-755

Add 'if defined' checks for all get_management_node_info calls

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.2
    • 2.4
    • vcld (backend)
    • None

    Description

      There are calls to get_management_node_info in utils.pm, DataStructure.pm, and healthcheck.pm which do not check if a defined value is returned such as:

      $identity_paths = get_management_node_info()->{keys};
      

      There are cases where get_management_node_info will fail and return null such as if a database connection cannot be obtained. When this happens and the caller doesn't check for a defined value, the following unhandled error is generated:

      Can't use an undefined value as a HASH reference at /usr/local/vcl/bin/../lib/VCL/utils.pm line 4017.

      Every line containing get_management_node_info()-> should be changed to first retrieve the info, then check it, then access the hash reference value.

      Attachments

        Activity

          People

            arkurth Andrew Kurth
            arkurth Andrew Kurth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: