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

BSD: upgrade support #305

Merged
merged 2 commits into from
May 4, 2020
Merged

Conversation

goneri
Copy link
Contributor

@goneri goneri commented Apr 3, 2020

Implement the upgrade support:

  • FreeBSD: using pkg upgrade
  • NetBSD: with pkgin

@goneri goneri changed the title bsd: upgrade support BSD: upgrade support Apr 3, 2020
Copy link
Collaborator

@igalic igalic left a comment

Choose a reason for hiding this comment

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

please fix this issue

cloudinit/distros/netbsd.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@igalic igalic left a comment

Choose a reason for hiding this comment

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

👍

@blackboxsw blackboxsw self-assigned this Apr 6, 2020
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

A couple of minor nits to get clarity. Thanks again.

cloudinit/distros/bsd.py Outdated Show resolved Hide resolved
cloudinit/distros/netbsd.py Show resolved Hide resolved
@goneri
Copy link
Contributor Author

goneri commented Apr 19, 2020

Thanks for the review @blackboxsw.

@goneri goneri requested a review from blackboxsw April 19, 2020 20:46
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

Thanks for the unit tests here, if possible, please align them with our new coding style suggestion for pytest.

tests/unittests/test_distros/test_netbsd.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

+1 with a minor nit on the unit test and a rebase against master. Then we'll land it.
thanks again!


distro = cloudinit.distros.netbsd.NetBSD("netbsd", cfg, None)
expectation = ['pkgin', '-y', 'full-upgrade'] if with_pkgin else None
assert distro.pkg_cmd_upgrade_prefix == expectation
Copy link
Collaborator

Choose a reason for hiding this comment

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

Excellent, can we add an assert about what if being checked by os.path.exists

Suggested change
assert distro.pkg_cmd_upgrade_prefix == expectation
assert distro.pkg_cmd_upgrade_prefix == expectation
assert [mock.call('/usr/pkg/bin/pkgin')] == m_os.path.exists.call_args_list

Implement the upgrade support:

- FreeBSD: using `pkg upgrade`
- NetBSD: with `pkgin`
Copy link
Collaborator

@blackboxsw blackboxsw left a comment

Choose a reason for hiding this comment

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

bring it home

@blackboxsw blackboxsw merged commit f9b393b into canonical:master May 4, 2020
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.

4 participants