roles: add gpo filesyspath method#260
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new filesyspath method to the GenericGPO interface, with corresponding implementations in the Active Directory (GPO) and Samba (SambaGPO) roles to allow overwriting the gPCFileSysPath attribute. The review feedback correctly identifies an issue in the Active Directory implementation where PowerShell failures are masked by an explicit Exit 0, and suggests setting $ErrorActionPreference = "Stop" to ensure errors are properly propagated.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| :return: Self. | ||
| :rtype: GenericGPO | ||
| """ | ||
| pass |
There was a problem hiding this comment.
| pass | |
| raise NotImplementedError() |
We should make sure this fails properly if used incorrectly.
| """ | ||
| Overwrite the GPO's ``gPCFileSysPath`` attribute. | ||
|
|
||
| Implements :meth:`GenericGPO.filesyspath`. | ||
|
|
||
| Used only to set up 'test_gpo__rejects_path_traversal_in_gpo_file_sys_path' test case. | ||
|
|
||
| :param path: gPCFileSysPath value. | ||
| :type path: str | ||
| :return: Group policy object | ||
| :rtype: GPO | ||
| """ |
There was a problem hiding this comment.
The docstring could use some tweaks.
The absstract method is hopefully not used in "test_gpo__rejects_path_traversal_in_gpo_file_sys_path"
An if it is we want proper exception.
needed to configure an invalid gpcfilesyspath value.
needed to configure an invalid gpcfilesyspath value.