-
Notifications
You must be signed in to change notification settings - Fork 40
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
base: master
Are you sure you want to change the base?
Conversation
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this 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'] |
There was a problem hiding this comment.
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 = { |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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? 😄
I will make the necessary changes. |
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.