Michael Pasternak has posted comments on this change.

Change subject: codegen, sdk: Use relative paths
......................................................................


Patch Set 2:

(1 comment)

http://gerrit.ovirt.org/#/c/23368/2/src/codegen/rsdl/rsdlcodegen.py
File src/codegen/rsdl/rsdlcodegen.py:

Line 85: 
Line 86:         # Get all the links from the RSDL document an make them 
relative:
Line 87:         links = proxy.request('GET', '?rsdl').links.link
Line 88:         for link in links:
Line 89:             link.href = link.href.replace(prefix, "")
> The "pop" mechanism can't be used, because the prefix can contain more than
> The "pop" mechanism can't be used, because the prefix can contain more than 
> one slash.

it can be used if you split by 'prefix' and do pop(0)

> I am replacing with "replace(prefix, "", 1)" so that only the first 
> occurrence will be removed. 

AFAICS you did:

link.href.replace(prefix, "")

which is return a copy of the string with all occurrences of substring old 
replaced by new

> This is safe assuming that all the links starts with the same prefix, and that

> is safe due to the way we currently generate the RSDL document.
Line 90: 
Line 91:         for link in links:
Line 92: 
Line 93:             response_type = None


-- 
To view, visit http://gerrit.ovirt.org/23368
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0e39510541e34349fce5a8ad4a643cf65784bccc
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine-sdk
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Michael Pasternak <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to