ID 537103 - ocionuke.config.getOCIOConfig() does not account for the OCIO environment variable

Follow

Problem summary:
ocionuke.config.getOCIOConfig() does not account for the OCIO environment variable
 
Customer reported version:
Nuke 13.2v5
 
Customer reported platform:
Windows 10
 
Steps to reproduce:
1) Open the Nuke installation directory and copy the /plugins/OCIOConfigs/configs/aces_<version>/config.ocio file.
2) Paste the file into the ~/Desktop directory and rename it "envar_config.ocio"
3) Open a Terminal/Command Prompt, and export or set the OCIO environment variable to the ~/Desktop/envar_config.ocio file.
- For example: export OCIO=~/Desktop/envar_config.ocio
4) Launch Nuke from the open Terminal/Command Prompt session, and run the following code inside Nuke's Script Editor:
import os, ocionukeif "OCIO" in os.environ:    print("OCIO path is: %s"%os.environ["OCIO"])else:    print("OCIO Enironment Variable is not set")print(ocionuke.config.getOCIOConfig())
6) Observe how the roles printed in the Script Editor do not match the roles inside the envar_config.ocio:

 
Expected behavior:
ocionuke.config.getOCIOConfig() should return the OCIO config that is currently active.
 
Actual behavior:
ocionuke.config.getOCIOConfig() returns the config in the root node's OCIO_config knob, not the config specified by the OCIO environment variable.
 
Workaround:
No known workaround at this time.
 
Reproduced by Support in:
Nuke 14.0v3 - Windows 10, CentOS 7
Nuke 13.0v1 - Windows 10
Nuke 12.0v1 - Windows 10, CentOS 7
 
Earliest version tested:
Nuke 12.0v1 - This issue appears to be in all tested versions of the product. Additionally, prior to 12.0v1, print(ocionuke.config.getOCIOConfig()) only returns the Python object. For example, <OCIO.Config object at 0x7f2ea5e1cdc8>

    We're sorry to hear that

    Please tell us why