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
Python 2to3, too #1227
Python 2to3, too #1227
Conversation
had to modify
|
🤡 I never ran it like that in dev mode, I used the |
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.
some nits
@multun all of those were added by 2to3. I'm a bit spooked about making those changes -- but trust your expertise. Would you mind sending my branch a PR? |
yeah sure ! I should probably have figured that out instead of making way too many comments, sorry about that |
No worries :D I appreciate you taking the time for it. Ping me here when you've opened that PR? |
@AmineChikhaoui I had to change the release.nix to create a nixops without any plugins, pass that to the plugins for testing, and then create a nixops combining them all together. Then I updated scripts/nixops to use python3 and verified it works ... can you try again? |
@grahamc thanks seems to be working now ! |
005ba0e
to
fc4e6f7
Compare
I rebased this on to the reformatted master, since reformatting & a mechanical 2->3 operation is probably a good thing to bulk together. |
This test assumes peculiar ordering guarantees which have changed from python2. This switches it to be the output from python3, but a proper fix would either to test equality only up to permutation, or to fix and guarantee an actual ordering.
fc4e6f7
to
eeac976
Compare
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.
Great stuff! Seems to be working well! I tried running without any plugins, only using deployment.targetHost
and could run create
, deploy
, ssh
, info
and export
without any issue.
I've tested this with 4 of my own deployments (mainly |
Note, other people can test this PR too. If you only use the
and use the resulting ./result/bin/nixops. |
btw I'm planning on merging this tomorrow. |
The last version wasn't correct. Added some types and validated with mypy.
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'm not approving the code (which I haven't looked at), but I'm approving that my usual nixops
workflow is fine with this build.
Thanks for your work @grahamc! 🎉
just tested this on darwin, got the following error:
we suspect that this is because not all hosts in the deployment are in the state file yet. /cc @lheckemann |
we just realised: this is correct but has nothing to do with the python3 changes and happens with |
Continues #1214 by @Taneb. The result of running 2to3 on the codebase, plus manual fixes when we're dealing with bytes and strings... plus a few minor 2-to-3 incompatibilities like Queue.Queue and output flushing.
I have tested this deploying to machines which are deployed without any plugin, as well as machines deployed with the nixops-packet plugin, using:
I have tested these things:
nixops ssh-for-each
nixops deploy
nixops deploy --force-reboot --exclude foo bar
nixops deploy -k
nixops deploy --include foo bar
nixops info
nixops list
nixops check
nixops send-keys
nixops show-arguments
(but I had none)nixops show-physical
nixops ssh
(both to and from)nixops dump-nix-paths
nixops export
I fixed many problems with combining bytes and strings in the logger, and bytes and strings when running remote commands. I fixed the stdout handler which had trouble with
b"" != ""
especially when detecting a remote SSH command was completed writing. I fixed the logger not flushing after each.
write, and not flushing when asking if destroying things is okay.IMO this is ready to go, and the upgrades to other plugins will need to be done after this merges.