Skip to content

Commit

Permalink
Add override_base_ftp_folder to errata tool variants
Browse files Browse the repository at this point in the history
JIRA: CWFCONF-5528
  • Loading branch information
Bryan Ramos committed Apr 24, 2024
1 parent 3a82661 commit aa5b2e5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ Errata Tool.
product_version: RHCEPH-4.0-RHEL-8
rhel_variant: 8Base
push_targets: []
override_ftp_base_folder: "8Base"
errata_tool_cdn_repo
--------------------
Expand Down
11 changes: 7 additions & 4 deletions library/errata_tool_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@
choices: [rhn_live, rhn_stage, cdn, cdn_stage, cdn_docker,
cdn_docker_stage]
required: true
override_ftp_base_folder:
description:
- Override the default base folder derived from Variant
- "example: 9Base"
required: false
requirements:
- "python >= 2.7"
- "lxml"
Expand Down Expand Up @@ -159,10 +165,6 @@ def prepare_diff_data(before, after):
item_name=after['name'],
item_type='variant',
keys_to_copy=[
# This field exists in ET but is not yet supported by
# this ansible module
'override_ftp_base_folder',

# The params may contain one or other of these
# but both are present in the before data
'tps_stream',
Expand Down Expand Up @@ -211,6 +213,7 @@ def run_module():
rhel_variant=dict(),
tps_stream=dict(),
push_targets=dict(type='list', required=True),
override_ftp_base_folder=dict(),
)
module = AnsibleModule(
argument_spec=module_args,
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/8Base-RHCEPH-4.0-Tools.variant.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"enabled": true,
"buildroot": false,
"tps_stream": "RHEL-8-Main-Base",
"override_ftp_base_folder": "8Base",
"relationships": {
"product": {
"id": 104,
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/8Base.variant.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"cpe": "",
"enabled": true,
"buildroot": false,
"override_ftp_base_folder": "8Base",
"relationships": {
"product": {
"id": 16,
Expand Down
2 changes: 2 additions & 0 deletions tests/test_errata_tool_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def params():
'push_targets': ['cdn'],
'buildroot': False,
'product_version': 'RHCEPH-4.0-RHEL-8',
'override_ftp_base_folder': '8Base',
}


Expand All @@ -55,6 +56,7 @@ def test_create_variant(self, client, params):
'product_version': 'RHCEPH-4.0-RHEL-8',
'push_targets': ['cdn'],
'buildroot': False,
'override_ftp_base_folder': '8Base',
}
}
assert history[0].json() == expected
Expand Down

0 comments on commit aa5b2e5

Please sign in to comment.