rubrik-modules-for-ansible
rubrik-modules-for-ansible copied to clipboard
create_physical_fileset is not idempotent
Running create_physical_fileset.py sample with the same input twice leads to exception.
Expected Behavior
The create_physical_fileset method should return that the file with the values exists.
Current Behavior
The method does not detect the existing fileset correctly and tries to create it which leads to an exception:
Traceback (most recent call last):
File "sample/create_physical_fileset.py", line 12, in <module>
new_fileset = rubrik.create_physical_fileset(name, operating_system, include, exclude, exclude_exception)
File "/usr/local/lib/python3.6/site-packages/rubrik_cdm/physical.py", line 198, in create_physical_fileset
return self.post('internal', '/fileset_template/bulk', model, timeout=timeout)
File "/usr/local/lib/python3.6/site-packages/rubrik_cdm/api.py", line 256, in post
authentication=authentication)
File "/usr/local/lib/python3.6/site-packages/rubrik_cdm/api.py", line 168, in _common_api
raise APICallException(error_message)
rubrik_cdm.exceptions.APICallException: A fileset template with name Python SDK already exists
Failure Information (for bugs)
Caused by mismatch of operating system type, input value is linux. internally it seems to be mapped to UnixLike. The get response returns UnixLike and the current_config and config will always br different.
- Use verbose outputs to capture any debug information.
Paste into a code block.
Steps to Reproduce
Running create_physical_fileset.py sample with the same input twice
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
- Version of project: 2.0.10 and devel branch
- Python 3
- RHEL 8.8