scripts/generate-iscsi-iqn
: Update the inline Python script for Py3
#5825
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @psafont and @ashwin9390,
Sinlge-line fix for Python3 support in https://github.com/xenserver-next/xen-api/blob/feature/py3/scripts/generate-iscsi-iqn
TL;DR
By visual inspection of the shell script
https://github.com/xenserver-next/xen-api/blob/feature/py3/scripts/generate-iscsi-iqn
(that runs an inline python script), I saw a remaining
print
statement, that needs to be a function:BTW: The inline Python script is used to reverse a domain name for the shell script:
PS: I guess that's something special for
iSCSI
(not related: DNS has the same of reverse DNS).PPS: That could likely be done in the shell itself, but since that's in a large loop (I guess) it shouldn't be a performance issue to call PYthon for reversing the domain name.
I tested the resulting shell script to successfully reverse the domain name with Python3 too.
Link to the commit: scripts/generate-iscsi-iqn: Fix inline Python to work in Py3