Uh oh!
There was an error while loading. Please reload this page.
Issue #2730 - better handle types for expanded variables - #2759
Conversation
There was a problem hiding this comment.
I'm not sure why this is necessary. On windows I would expect os.path to return the correct paths.
There was a problem hiding this comment.
the if sys.platform == "win32": was here in the code I moved ...
There was a problem hiding this comment.
Ah yes, I saw that, but I'm not sure why it's there either. This is mostly just a question, it may be necessary. If you can remove it and the appveyor tests pass (they run on windows) then I think it's safe to remove.
tiry
commented
Feb 1, 2016
I'll try to integrate the feedback asap and will resubmit. |
There was a problem hiding this comment.
This seems overly complex. I think supporting arrays is probably the most contentious part of this feature. I think we should try to keep it as straightforward as possible.
How about:
returnjson.loads(interpolated_value)Although, I wonder if it should actually be yaml.safe_load() since the config is yaml format. Using yaml would support json as well.
There was a problem hiding this comment.
As I said I have not written python for years, but it seems that json.loads does not work with an Array.
Looks like I am not the only one to face the issue
=> http://stackoverflow.com/questions/10973614/convert-json-array-to-python-list
However, it may be just because of issue between simple quotes (') and double quotes (")
There was a problem hiding this comment.
I think that's it. json only supports double quotes for strings.
dnephin
commented
Feb 1, 2016
Thanks for the PR! I think it's on the right track. We'll need some time to discuss it for the 1.7 release, so it might be another couple weeks before we can give any more design feedback. |
tiry
commented
Feb 1, 2016
What is the preferred process on your side :
NB : I know this is a kind a "religious" question, so I prefer to ask before doing something inappropriate :) |
dnephin
commented
Feb 1, 2016
New commits are fine. You may be asked to squash at the end, right before merging. Or you could also squash them now if you think it's warranted. |
tiry
commented
Feb 2, 2016
Here is a new version. I say most, because while changing the code I realized that some cases where not handled, so I added more tests and adapted the implementation. |
tiry
commented
Feb 2, 2016
Not sure I understand the problem on the Jenkins build: it is related to my changes or can it come from other changes ? |
dnephin
commented
Feb 2, 2016
They look unrelated |
tiry
commented
Feb 2, 2016
Ok, should I do something to restart the build / check ? |
tiry
commented
Feb 10, 2016
Looks like I need to rebase my changes ... will do it when I find the time |
Signed-off-by: Thierry Delprat <tdelprat@nuxeo.com>
Signed-off-by: Thierry Delprat <tdelprat@nuxeo.com>
Signed-off-by: Thierry Delprat <tdelprat@nuxeo.com>
flx42
commented
Feb 22, 2016
Any progress @tiry? Since this PR is solving #2750, it would be great for nvidia-docker. Thank you for your work! |
tiry
commented
Feb 22, 2016
I did a rebase (+fixes) and everything seems to work on my side ... let's see what you CI says ! |
tiry
commented
Feb 22, 2016
It does not look like the build failure is related to my code. |
flx42
commented
Feb 22, 2016
I don't know how the CI works for |
Signed-off-by: Thierry Delprat <tdelprat@nuxeo.com>
tiry
commented
Feb 22, 2016
Fair enough, I was just looking for a cleaner option. |
tiry
commented
Feb 22, 2016
Failed again so the error does not seem to be transient. Thank you ! |
dnephin
commented
Feb 23, 2016
yes, the failures are unrelated, i've started another build now that the issue should be fixed. |
tiry
commented
Feb 23, 2016
Great, let me know if you have further feedback ! |
tiry
commented
Feb 26, 2016
I could rebase once more, but I would need to have some feedback from you guys otherwise this is kind of pointless. |
dnephin
commented
Feb 26, 2016
Yup, don't worry about rebasing just yet, we'll need to look over it again |
ruffsl
commented
Apr 26, 2016
Any status on review of this PR? I'm here coming from the same nvidia-docker related camp (#2750 and NVIDIA/nvidia-docker#39) as @flx42 . |
Here is a changeset to handle automatic cast based on the types defined in the jsonschema.
I added test for my use case as well as for #2750.
My python is pretty rusted, but it seems to work as expected ... let me know what you think.