Skip to content

Network config generation exception#709

Merged
OddBloke merged 5 commits into
canonical:masterfrom
trstringer:thstring/net-config-gen-fix
Dec 16, 2020
Merged

Network config generation exception#709
OddBloke merged 5 commits into
canonical:masterfrom
trstringer:thstring/net-config-gen-fix

Conversation

@trstringer
Copy link
Copy Markdown
Contributor

@trstringer trstringer commented Dec 3, 2020

Proposed Commit Message

Prevent network interfaces without IP addresses from being added to the generated network configuration.

Additional Context

There are situations where a network interface might not have any associated IP addresses with it (this is by-design). In this case, the network configuration that is generated would currently still include these network interfaces. This could cause issues and delays in provisioning, for example if systemd-networkd-wait-online is running it would be waiting until timeout because any interface without an IP address would not ever come online.

This PR adds a check to make sure that we are only generating network configuration for devices with IP addresses.

Test Steps

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

@anhvoms
Copy link
Copy Markdown
Contributor

anhvoms commented Dec 4, 2020

Can you add a unit test to cover the case where if ipaddress isn't there, the network config for the interface would not be generated?

Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks!

@trstringer
Copy link
Copy Markdown
Contributor Author

Thanks for the review and approval, @OddBloke!

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.

3 participants