Multi-Fault Debugging Challenge: Fixing Multiple Bugs in Ansible Code
Task Overview
You are tasked with identifying and fixing 3 separate bugs in the Ansible codebase located in the file /app/solution.py. This is a multi-fault debugging exercise where you must ensure that all identified issues are resolved for the task to be considered successful.
Bug Descriptions
Bug 1 (ID: 1)
In the verify_collections function, there's a missing check for the presence of a crucial file named MANIFEST.json. If this file is absent in the specified collection path, the application does not currently raise an appropriate error. This could lead to runtime issues when a collection does not adhere to the expected structure.
Bug 2 (ID: 3)
Within the DistributionFiles class, there's an incorrect condition for identifying the distribution when dealing with the 'Kali' OS. The current implementation assumes the presence of only one specific file. However, this file is no longer provided by Kali, and it should account for an alternative file to ensure accurate detection of the operating system.
Bug 3 (ID: 8)
In the ShellModule class, the method responsible for joining file paths is currently flawed. It improperly handles and normalizes path components, specifically concerning path separators. This could result in incorrect path formation, particularly when dealing with different file system conventions.
Instructions
Your objective is to locate and fix all the bugs mentioned above in the /app/solution.py file. Make sure to review the code thoroughly and apply the necessary changes without revealing or duplicating the exact fixes outlined in the patches provided.
Once you believe you have resolved all issues, tests will be conducted to verify your fixes through the statement from solution import *.
Important Note
All bugs must be fixed for the task to pass! Be diligent, as leaving even one bug unresolved will result in a failed task. Good luck!
Note (env layout): The buggy starter code is at /setup_files/solution.py. The verifier and tests run against /app/solution.py. Read /setup_files/solution.py, fix the bugs, and write the corrected version to /app/solution.py.