-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a distinction between the product-ready OS and the product WFs
- Loading branch information
Showing
7 changed files
with
75 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Robottelo configuration migrations""" | ||
|
||
from packaging.version import Version | ||
|
||
from robottelo.logging import logger | ||
|
||
|
||
def migration_231129_deploy_workflow(settings, data): | ||
"""Migrates {server,capsule}.deploy_workflow to {server,capsule}.deploy_workflows""" | ||
for product_type in ['server', 'capsule']: | ||
# If the product_type has a deploy_workflow and it is a string, and it does not have a deploy_workflows set | ||
if ( | ||
settings[product_type].get('deploy_workflow') | ||
and isinstance(settings[product_type].deploy_workflow, str) | ||
and not settings[product_type].get('deploy_workflows') | ||
): | ||
sat_rhel_version = settings[product_type].version.rhel_version | ||
data[product_type] = {} | ||
# Set the deploy_workflows to a dict with product and os keys | ||
# Get the OS workflow from the content_host config | ||
data[product_type].deploy_workflows = { | ||
'product': settings[product_type].deploy_workflow, | ||
'os': settings.content_host[ | ||
f'rhel{Version(str(sat_rhel_version)).major}' | ||
].vm.workflow, | ||
} | ||
logger.info( | ||
f'Migrated {product_type}.DEPLOY_WORKFLOW to {product_type}.DEPLOY_WORKFLOWS' | ||
) | ||
else: | ||
logger.info( | ||
f'No migration needed for {product_type}.DEPLOY_WORKFLOW to {product_type}.DEPLOY_WORKFLOWS. DEPLOY_WORKFLOWS is already set.' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters