You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The emulation code for the ./Systems/{id}/ResetAction resource in located in the file ./api_emulator/redfish/ComputerSystem/ResetAction.py. A behavior of a reset action is to change the ComputerSystem.Status.State property. However, this requires the code import a module within the ComputerSystem.py code in the parent directory. Python 3.3 removed relative imports, so imports from a parent directory requires hacking PYTHONPATH or adding the parent-path to sys.path.
There is a request for a cleaner way.
The text was updated successfully, but these errors were encountered:
The construct of the folders is to have a resource.py and resource_api.py code in ./redfish and the template files (resource_template.py) in the directory ./redfish/templates. This allowed the resource behavior code to import from each other modules from each other within their scope (and avoid running afoul with recursive imports). The creation of the ./redfish/ComputerSystem directory violates the above construct.
The fix is to move to resource.py, resource_api,py resource_template.py files to their proper directory and remove the ./ComputerSystem directory.
The emulation code for the ./Systems/{id}/ResetAction resource in located in the file ./api_emulator/redfish/ComputerSystem/ResetAction.py. A behavior of a reset action is to change the ComputerSystem.Status.State property. However, this requires the code import a module within the ComputerSystem.py code in the parent directory. Python 3.3 removed relative imports, so imports from a parent directory requires hacking PYTHONPATH or adding the parent-path to sys.path.
There is a request for a cleaner way.
The text was updated successfully, but these errors were encountered: