Skip to content
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

Start with types #1233

Merged
merged 6 commits into from Feb 29, 2020
Merged

Conversation

TheWizardTower
Copy link
Contributor

A few commits. The first batch are cleanup-things of lint flags that my editor told me about; the last one is the one that changes business logic.

I added type annotations to nixops/nixops/known_hosts.py.

I haven't tested this at all, as I'm brand new to the repo and to nixos in general. I'm just fairly familiar with working with static type systems. :)

Looking forward to finding what I've broken.

@TheWizardTower TheWizardTower changed the base branch from master to start-with-types February 29, 2020 15:59
@grahamc
Copy link
Member

grahamc commented Feb 29, 2020

Thank you a lot!

@grahamc grahamc merged commit ccd2fa4 into NixOS:start-with-types Feb 29, 2020
bhipple added a commit to bhipple/nixops-aws that referenced this pull request Mar 22, 2020
Previously, the nixops-aws plugin was always calling
`known_hosts.update(old, new, val)`.

As of this commit [1], all arguments to the `update` function must be non-null.
While we could modify the `update` function in nixops to have the previous
behavior, it makes more sense for us to just call `add` when we mean add, and
`remove` when we mean remove.

[1] NixOS/nixops#1233
remove(prev_address, public_host_key)
if new_address is not None:
add(new_address, public_host_key)
add(new_address, public_host_key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a heads up, this is a backwards incompatible API change to the function. I think it's a good change, but previously plugins like nixops-aws were calling "update" with None values to mean "remove" or "add". I've fixed nixops-aws by having it call add or remove directly, but it may be worth scanning other plugins to see how they're calling update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants