Skip to content

Refactoring helper funcs out of NetworkState#1336

Merged
TheRealFalcon merged 1 commit into
canonical:mainfrom
akutz:feature/net-func-refactor
Mar 15, 2022
Merged

Refactoring helper funcs out of NetworkState#1336
TheRealFalcon merged 1 commit into
canonical:mainfrom
akutz:feature/net-func-refactor

Conversation

@akutz
Copy link
Copy Markdown
Contributor

@akutz akutz commented Mar 15, 2022

Proposed Commit Message

Refactoring helper funcs out of network_state

This patch refactors several network, helper functions out of the
network_state.py file and into cloudinit.net. This is in relation
to LP #1855945 and github.com/canonical/cloud-init/pull/1327. The
aforementioned issue requires some refactoring to avoid circular
imports, but it was not proper to do that refactoring in *that*
pull request. Thus this PR is specific to the refactoring and can
be evaluated on its own merits.

LP: #1855945 (partial)

cc @TheRealFalcon

Additional Context

Please see #1327 and #1327 (comment) for more information.

Test Steps

make clean_pyc && PYTHONPATH="$(pwd)" \
  python3 -m pytest -v --log-level=DEBUG \
  tests/unittests/test_net.py \
  tests/unittests/net/test_network_state.py 

I also ran this, and the only failing tests were because I was on a mac:

make clean_pyc && PYTHONPATH="$(pwd)" python3 -m pytest -v tests/unittests

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Mar 15, 2022

Oh fun, I suppose I need to actually run all the unit tests locally to find what I broke 😃

@akutz akutz force-pushed the feature/net-func-refactor branch from 28b37bc to 77d9b8a Compare March 15, 2022 17:53
This patch refactors several network, helper functions out of the
network_state.py file and into cloudinit.net. This is in relation
to LP #1855945 and github.com/canonical/pull/1327. The
aforementioned issue requires some refactoring to avoid circular
imports, but it was not proper to do that refactoring in *that*
pull request. Thus this PR is specific to the refactoring and can
be evaluated on its own merits.
@akutz akutz force-pushed the feature/net-func-refactor branch from 77d9b8a to 245980d Compare March 15, 2022 18:23
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon 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 this! To be clear, when I mentioned that ideally we'd move those functions, I wasn't expecting you to do it...but I appreciate it 🙂

@TheRealFalcon TheRealFalcon merged commit 34ab8d6 into canonical:main Mar 15, 2022
@akutz
Copy link
Copy Markdown
Contributor Author

akutz commented Mar 15, 2022

Thanks for this! To be clear, when I mentioned that ideally we'd move those functions, I wasn't expecting you to do it...but I appreciate it 🙂

Well, I mean someone was going to end up doing it. Why not me? 😄

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.

2 participants