Skip to content

Conversation

carbonin
Copy link
Member

Implements the current functions of the LinuxAdmin::IpAddress class as well as distro specific functions for setting IP addresses and DNS servers.

Uses the distro detection in LinuxAdmin::Distros to determine which sub-class to instantiate at run-time.

Currently supports Red Hat based distros (CentOS, Fedora, and RHEL).

@bdunne @Fryguy please review.

Copy link
Member

Choose a reason for hiding this comment

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

You'll never hit this raise, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Right! That was from before I put the generic class in.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bdunne Should we also clear the DNS server and search order here and assume that will be set by DHCP?

Copy link
Member

Choose a reason for hiding this comment

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

yes

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Member

Choose a reason for hiding this comment

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

What is the RH in NetworkInterfaceRH? Does that stand for Red Hat (the company) or RHEL (the OS)? If the latter, then I would rename to NetworkInterfaceRHEL.

Copy link
Member Author

Choose a reason for hiding this comment

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

My intention was "Red Hat" as the class is able to provide network configuration for CentOS, Fedora, and RHEL.

Copy link
Member

Choose a reason for hiding this comment

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

What if it's IPv6?

Copy link
Member Author

Choose a reason for hiding this comment

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

Typo, this will work for both, I used to have two different parts to handle the different types and forgot to change the message/docs

@Fryguy
Copy link
Member

Fryguy commented Oct 16, 2015

Awesome stuff here!

@carbonin carbonin force-pushed the add_network_interface_class branch 2 times, most recently from 676147f to e483a86 Compare October 20, 2015 19:09
Copy link
Member

Choose a reason for hiding this comment

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

This should be message, result

The NetworkInterface switches which object gets instantiated
based on the distro that we are running on.

https://trello.com/c/rWKh4KQs
This prevents us from shelling out every time a user asks for
some network setting.  Also created a reload method to re-parse
the settings.

https://trello.com/c/rWKh4KQs
Also defined an exception type for the NetworkInterface classes and
raise that when `run!` raises a CommandResultError

https://trello.com/c/rWKh4KQs
@carbonin carbonin force-pushed the add_network_interface_class branch from 7c2c432 to 74ba406 Compare October 21, 2015 18:51
@miq-bot
Copy link
Member

miq-bot commented Oct 21, 2015

Checked commits carbonin/linux_admin@964e81e~...74ba406 with ruby 1.9.3, rubocop 0.34.2, and haml-lint 0.13.0
7 files checked, 2 offenses detected

lib/linux_admin/network_interface.rb

  • 🔹 - Line 44, Col 5 - Metrics/AbcSize - Assignment Branch Condition size for reload is too high. [16.76/15]

spec/network_interface/network_interface_rh_spec.rb

  • 🔹 - Line 201, Col 5 - Metrics/AbcSize - Assignment Branch Condition size for expect_old_contents is too high. [25/15]

@bdunne
Copy link
Member

bdunne commented Oct 21, 2015

👍 LGTM, will merge when green.

bdunne added a commit that referenced this pull request Oct 22, 2015
Add distro specific network interface class
@bdunne bdunne merged commit 91567b8 into ManageIQ:master Oct 22, 2015
@carbonin carbonin deleted the add_network_interface_class branch November 13, 2015 20:16
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.

5 participants