Skip to content

Commit

Permalink
only allow chunk_size_gb for importable exports
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Jul 25, 2024
1 parent 251b53b commit 756ac2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/1738-export_chunk_size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- content_export_* - document that ``chunk_size_gb`` parameter is only applicable for ``importable`` exports (https://github.com/theforeman/foreman-ansible-modules/issues/1738)
1 change: 1 addition & 0 deletions plugins/doc_fragments/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ class ModuleDocFragment(object):
chunk_size_gb:
description:
- Split the exported content into archives no greater than the specified size in gigabytes.
- Only applicable for C(format=importable). C(syncable) exports can't be split.
required: false
type: int
format:
Expand Down
3 changes: 3 additions & 0 deletions plugins/module_utils/foreman_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,9 @@ def run(self, **kwargs):
if self.params.get('from_history_id') and incremental is not True:
self.fail_json(msg='from_history_id is only valid for incremental exports')

if 'chunk_size_gb' in self.foreman_params and self.foreman_params['format'] == 'syncable':
self.fail_json(msg='chunk_size_gb is only valid for importable exports')

self.auto_lookup_entities()

payload = _flatten_entity(self.foreman_params, self.foreman_spec)
Expand Down

0 comments on commit 756ac2b

Please sign in to comment.