Skip to content

Commit

Permalink
WIP: Rewrite utility script task in the buildchain
Browse files Browse the repository at this point in the history
  • Loading branch information
sayf-eddine-scality committed Aug 12, 2019
1 parent a7643ef commit 66fdb5c
Showing 1 changed file with 19 additions and 34 deletions.
53 changes: 19 additions & 34 deletions buildchain/buildchain/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,44 +119,29 @@ def task__iso_add_node_manifest() -> types.TaskDict:

def task__iso_add_utilities_scripts() -> types.TaskDict:
"""Copy the ISO manager script to scripts."""
iso_manager_src = constants.ROOT/'scripts'/'iso-manager.sh'
iso_manager_dest = constants.ISO_ROOT/'iso-manager.sh'
iso_manager = [iso_manager_src, iso_manager_dest]

downgrade_src = constants.ROOT/'scripts'/'downgrade.sh'
downgrade_dest = constants.ISO_ROOT/'downgrade.sh'
downgrade = [downgrade_src, downgrade_dest]

upgrade_src = constants.ROOT/'scripts'/'upgrade.sh'
upgrade_dest = constants.ISO_ROOT/'upgrade.sh'
upgrade = [upgrade_src, upgrade_dest]

solution_src = constants.ROOT/'scripts'/'solution-manager.sh'
solution_dest = constants.ISO_ROOT/'solution-manager.sh'
solution = [solution_src, solution_dest]
files = (
(
constants.ROOT/'scripts'/'iso-manager.sh',
constants.ISO_ROOT/'iso-manager.sh'
), (
constants.ROOT/'scripts'/'downgrade.sh',
constants.ISO_ROOT/'downgrade.sh'
), (
constants.ROOT/'scripts'/'upgrade.sh',
constants.ISO_ROOT/'upgrade.sh'
), (
constants.ROOT/'scripts'/'solution-manager.sh',
constants.ISO_ROOT/'solution-manager.sh'
)
)
return {
'title': utils.title_with_target1('COPY'),
'actions': [
(coreutils.cp_file, iso_manager),
(coreutils.cp_file, downgrade),
(coreutils.cp_file, upgrade),
(coreutils.cp_file, solution)
],
'targets': [
iso_manager_dest,
downgrade_dest,
upgrade_dest,
solution_dest,
],
'actions': [ (coreutils.cp_file, filepair) for filepair in files],
'targets': [filepair[1] for filepair in files],
'task_dep': ['_iso_mkdir_root'],
'file_dep': [
iso_manager_src,
downgrade_src,
upgrade_src,
solution_src,
],
'file_dep': [filepair[0] for filepair in files],
'clean': True,
}
}


def task__iso_render_bootstrap() -> types.TaskDict:
Expand Down

0 comments on commit 66fdb5c

Please sign in to comment.