@@ -379,7 +379,7 @@ def process_file_without_download(repository_name, output_file, relative_path,
379
379
finally :
380
380
logger .info ("#" * 30 + f" { process_file_without_download .__name__ } end " + "#" * 30 )
381
381
382
- def process_manifest (file ,repo_store_path , status_file_path ,logger ):
382
+ def process_manifest (file ,repo_store_path , status_file_path , cluster_os_type , cluster_os_version , arc , logger ):
383
383
"""
384
384
Process a manifest file.
385
385
Args:
@@ -404,7 +404,7 @@ def process_manifest(file,repo_store_path, status_file_path,logger):
404
404
subprocess .run (['wget' , '-q' , '--spider' , '--tries=1' , url ], check = True )
405
405
406
406
# Ensure the manifest directory exists
407
- manifest_directory = os .path .join (repo_store_path , "offline_repo" , "cluster" , "manifest" , package_name )
407
+ manifest_directory = os .path .join (repo_store_path , "offline_repo" , "cluster" ,arc . lower (), cluster_os_type , cluster_os_version , "manifest" , package_name )
408
408
# # Determine the manifest file path
409
409
file_path = os .path .join (manifest_directory , f"{ package_name } .yaml" )
410
410
repository_name = "manifest" + package_name
@@ -427,7 +427,7 @@ def process_manifest(file,repo_store_path, status_file_path,logger):
427
427
logger .info ("#" * 30 + f" { process_manifest .__name__ } end " + "#" * 30 ) # End of function
428
428
return status
429
429
430
- def process_git (file ,repo_store_path , status_file_path ,logger ):
430
+ def process_git (file ,repo_store_path , status_file_path , cluster_os_type , cluster_os_version , arc , logger ):
431
431
"""
432
432
Process a Git package.
433
433
Args:
@@ -455,7 +455,7 @@ def process_git(file,repo_store_path, status_file_path,logger):
455
455
logger .info (f"Processing Git Package: { package_name } , URL: { url } , Version: { version } " )
456
456
457
457
# Assuming you have a specific path to store Git packages
458
- git_modules_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , 'git' , package_name )
458
+ git_modules_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' ,arc . lower (), cluster_os_type , cluster_os_version , 'git' , package_name )
459
459
os .makedirs (git_modules_directory , exist_ok = True ) # Ensure the directory exists
460
460
461
461
clone_directory = os .path .join (git_modules_directory , package_name )
@@ -502,7 +502,7 @@ def process_git(file,repo_store_path, status_file_path,logger):
502
502
return status
503
503
504
504
# Function to process a shell file
505
- def process_shell (file ,repo_store_path , status_file_path ,logger ):
505
+ def process_shell (file ,repo_store_path , status_file_path , cluster_os_type , cluster_os_version , arc , logger ):
506
506
"""
507
507
Process a shell package.
508
508
@@ -526,7 +526,7 @@ def process_shell(file,repo_store_path, status_file_path,logger):
526
526
logger .info (f"Processing sh Package: { package_name } , URL: { url } " )
527
527
528
528
# Creating the local path to save the sh file
529
- sh_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , 'shell' , package_name )
529
+ sh_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' ,arc . lower (), cluster_os_type , cluster_os_version , 'shell' , package_name )
530
530
os .makedirs (sh_directory , exist_ok = True ) # Ensure the directory exists
531
531
532
532
sh_path = os .path .join (sh_directory , f"{ package_name } .sh" )
@@ -548,7 +548,7 @@ def process_shell(file,repo_store_path, status_file_path,logger):
548
548
logger .info ("#" * 30 + f" { process_shell .__name__ } end " + "#" * 30 ) # End of function
549
549
return status
550
550
551
- def process_ansible_galaxy_collection (file , repo_store_path , status_file_path , logger ):
551
+ def process_ansible_galaxy_collection (file , repo_store_path , status_file_path , cluster_os_type , cluster_os_version , arc , logger ):
552
552
"""
553
553
Process an Ansible Galaxy Collection.
554
554
@@ -577,7 +577,7 @@ def process_ansible_galaxy_collection(file, repo_store_path, status_file_path, l
577
577
)
578
578
579
579
# Assuming you have a specific path to store Ansible Galaxy Collections
580
- galaxy_collections_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , 'ansible_galaxy_collection' , package_name )
580
+ galaxy_collections_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , arc . lower (), cluster_os_type , cluster_os_version , 'ansible_galaxy_collection' , package_name )
581
581
galaxy_collections_directory = shlex .quote (galaxy_collections_directory ).strip ("'\" " )
582
582
os .makedirs (galaxy_collections_directory , exist_ok = True ) # Ensure the directory exists
583
583
collections_tarball_path = os .path .join (galaxy_collections_directory , f'{ package_name .replace ("." , "-" )} -{ version } .tar.gz' )
@@ -852,7 +852,7 @@ def process_iso(package, repo_store_path, status_file_path,
852
852
logger .info ("#" * 30 + f" { process_iso .__name__ } end " + "#" * 30 ) # End of function
853
853
return status
854
854
855
- def process_pip (package , repo_store_path , status_file_path , logger ):
855
+ def process_pip (package , repo_store_path , status_file_path , cluster_os_type , cluster_os_version , arc , logger ):
856
856
"""
857
857
Process a pip package using Pulp.
858
858
@@ -877,8 +877,8 @@ def process_pip(package, repo_store_path, status_file_path, logger):
877
877
logger .info (f"Processing Pip Package: { package_name } , Version: { version } " )
878
878
879
879
# Define storage path
880
- pip_package_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , 'pip_module' , package_name )
881
- base_package_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , 'pip_module' , package_name )
880
+ pip_package_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' ,arc . lower (), cluster_os_type , cluster_os_version , 'pip_module' , package_name )
881
+ base_package_directory = os .path .join (repo_store_path , "offline_repo" , 'cluster' , arc . lower (), cluster_os_type , cluster_os_version , 'pip_module' , package_name )
882
882
base_package_directory = base_package_directory .strip ("/" )
883
883
884
884
os .makedirs (pip_package_directory , exist_ok = True ) # Ensure directory exists
0 commit comments