Skip to content

(#20229) Fix per-interface netmask_* facts with net-tools 1.60#432

Merged
adrienthebo merged 3 commits intopuppetlabs:stablefrom
jeffmccune:fix_netmask_scanner
May 24, 2013
Merged

(#20229) Fix per-interface netmask_* facts with net-tools 1.60#432
adrienthebo merged 3 commits intopuppetlabs:stablefrom
jeffmccune:fix_netmask_scanner

Conversation

@jeffmccune
Copy link

Without this patch the interface specific facts for the netmask are not
correctly parsed on systems with net-tools 1.60 or later, such as
Archlinux.

This patch addresses the problem by adjusting the regular expression to
take into account the new format of the ifconfig command.

This patch is specific to the netmask_* facts and does not affect the
behavior of the general netmask fact.

@puppetcla
Copy link

CLA Signed by jeffmccune on 2010-08-16 21:00:00 -0700

@jeffmccune
Copy link
Author

Closing this pull request until the other facts like netmask are fixed up as well.

@jeffmccune jeffmccune closed this Apr 18, 2013
@jeffmccune jeffmccune reopened this Apr 18, 2013

Choose a reason for hiding this comment

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

Will this configure block be localized to only this spec file?

Copy link
Author

Choose a reason for hiding this comment

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

No, it affects global state. I chose to do it here for readability.

Choose a reason for hiding this comment

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

So for my understanding, this is to make the shared example code more descriptive and emit more descriptive messages with --format documentation or are there functional behavior changes as well?

Copy link
Author

Choose a reason for hiding this comment

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

It's to be more descriptive, yes. It doesn't actually change the behavior of the system in any way AFAICT.

@adrienthebo
Copy link

@jeffmccune would you like me to fix this up? How would you like to see this deduplicated?

@jeffmccune
Copy link
Author

@jeffmccune would you like me to fix this up? How would you like to see this deduplicated?

If you have the bandwidth, yes, that'd be great. I don't really have any preference on how to deduplicate this, perhaps just factoring out the RSpec.configure block into a small file that both examples require, like they do with spec_helper, would be clear and sufficient.

Jeff McCune added 3 commits May 24, 2013 11:21
Without this patch the interface specific facts for the netmask are not
correctly parsed on systems with net-tools 1.60 or later, such as
Archlinux.

This patch addresses the problem by adjusting the regular expression to
take into account the new format of the ifconfig command.

This patch is specific to the netmask_* facts and does not affect the
behavior of the general `netmask` fact.
Without this patch the netmask fact does not return a value on Archlinux
because of the new format of the net-tools package.

This patch addresses the problem by updating the regular expressions for
the netmask fact.  Both the old format and the new format are covered by
the regular expression now.
Adrien pointed out the duplication of

    RSpec.configure do |config|
      config.alias_it_should_behave_like_to :example_behavior_for, "parses"
    end

in both of the interfaces_spec file and the netmask_spec file.  This
patch removes the duplicate statements and places them in a shared file
required by both example specs.
@jeffmccune
Copy link
Author

@adrienthebo I've fixed this up and moved the configure statements into their own file. As soon as Github catches up and re-synchronizes this pull request it should be ready for merge.

adrienthebo added a commit that referenced this pull request May 24, 2013
(#20229) Fix per-interface netmask_* facts with net-tools 1.60
@adrienthebo adrienthebo merged commit c7407f8 into puppetlabs:stable May 24, 2013
@adrienthebo
Copy link

Summary: merged into master in c7407f8. This should be released in 1.7.2. Thanks!

florindragos pushed a commit that referenced this pull request Jun 15, 2020
* (maint) Fixed master
* (FACT-2401) Refactor Options
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