Pattern debugger sa_mapping_ext_commands fails due to osFamily and osType set to proprietary


Description

Pattern debugger sa_mapping_ext_commands fails due to osFamily and osType set to proprietary.

On the pattern debugger this can be seen under the Temporary Variables:

Steps to Reproduce

  1. Open the "Windows OS - Desktops" pattern
  2. Click on "Debug Mode"
  3. Set a mid server and ip address
  4. Click on "Connect"
  5. Execute step "Failover step to get EC2 Details PS Script"
  6. Step fails with error
    Step failed: Failed to locate file with logical name: Get EC2 Details, for OS family: PROPRIETARY, OS type: PROPRIETARY 64 bit

Workaround

  1. Update script include DiscoveryHostsUtils function getOsFamily() to:

     if (sysClassName == "cmdb_ci_computer") {
         // os cannot be null. It can be an empty string or the string "undefined".
         // this bug is since Geneva. We are not fixing it at this time.
      if (os != null) {
       if (os.indexOf('Windows') == 0)
        return 'WINDOWS';
       if (os.indexOf('Linux') == 0)
        return 'UNIX';
       if (os.indexOf('AIX') == 0)
        return 'UNIX';
       if (os.indexOf('Solaris') == 0)
        return 'UNIX';
       if (os.indexOf('HP/UX') == 0)
        return 'UNIX';
       if (os.indexOf('Mac') == 0)
        return 'UNIX';
      }
        if (os != null) {
        return 'WINDOWS'
      }
     }

Note: In the above we added the section highlighted in yellow. There you would add the necessary os family to get the step in the debugger to run without an error. In this example the os family was WINDOWS. Also, the change should only be kept while necessary to keep a pattern debug section from having errors. Once development/changes to a pattern are complete, revert the script to OOB.


Related Problem: PRB1520583