Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ibm-validated behavior consistent in package_build.py #188

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Apurv428
Copy link
Contributor

@Apurv428 Apurv428 commented May 8, 2024

Resolved issue #184
The PR modifies the script to standardize the behavior by allowing generation of all available ibm-validated distribution sources without requiring additional arguments, simplifying usage and aligning it with other functionalities.

Signed-off-by: Apurv Sonawane <apurvsonawane28@gmail.com>
@@ -273,66 +273,35 @@ def getIBMValidatedOpenSourceList(oskey):
print("Couldn't pull. Error: ",str(e))
else:
data_json = json.loads(data)
osversions = ['SLES 12.x', 'SLES 15.x', 'Ubuntu 20.x', 'Ubuntu 22.x', 'RHEL 8.x/7.x', 'RHEL 9.x']
for oskey in os_versions:
Copy link
Contributor

@pleia2 pleia2 May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to switch to using tabs for the indentation, it's throwing errors for me when I run it.

Copy link
Contributor

@pleia2 pleia2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first comment is that you should be more descriptive with your commit message title. "Updated script" is very vague. Which script? What are you fixing? It does need to be short, but it could be something like: Make ibm-validated behavior consistent in package_build.py

Next, you're using an older version of this script so it's non-functional in the current state. Always be sure you sync your repository with the master/main branch of the main project before proceeding.

In this case, the impacted component is line 266 where the URL has been replaced with the functional one: https://community.ibm.com/zsystems/api/oss/json

Even with that fix, it's still not working properly. Always be sure to test the script locally before you submit a PR. I've noted some of the changes you need below, but left the last puzzle for you.

@@ -273,66 +273,35 @@ def getIBMValidatedOpenSourceList(oskey):
print("Couldn't pull. Error: ",str(e))
else:
data_json = json.loads(data)
osversions = ['SLES 12.x', 'SLES 15.x', 'Ubuntu 20.x', 'Ubuntu 22.x', 'RHEL 8.x/7.x', 'RHEL 9.x']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want os_versions here

with open(file_name,'w') as file:
json.dump(rhel9_list,file,indent=2)
print(f"Saved!\nfilename: {q}")
osversions_dict = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And os_versions_dict here


q = f'IBM_Validated_OSS_List{os_version_name}.json'
file_name = f'{DATA_FILE_LOCATION}/{q}'
with open(file_name, 'w') as file:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's actually saving the files as the first item in the key/value store, so we're getting files with the following name:

IBM_Validated_OSS_ListSLES 12x.json

Rather than what we want: IBM_Validated_OSS_List_SLES_12.json

And that also means it errors our when it tries to name something "IBM_Validated_OSS_ListRHEL 8x/7x.json" since the forward slash is throwing off the script.

Can you make the changes I suggested above, and then test the script and see if you can figure out how to fix this one? 😄

@Apurv428 Apurv428 changed the title Updated Script Ibm-validated behavior consistent in package_build.py May 10, 2024
@Apurv428
Copy link
Contributor Author

I will make the necessary changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants