Skip to content

(#17521) Add osfamily fact ArchLinux#352

Closed
aboe76 wants to merge 1 commit intopuppetlabs:masterfrom
aboe76:osfamily_archlinux
Closed

(#17521) Add osfamily fact ArchLinux#352
aboe76 wants to merge 1 commit intopuppetlabs:masterfrom
aboe76:osfamily_archlinux

Conversation

@aboe76
Copy link

@aboe76 aboe76 commented Nov 10, 2012

Archlinux doesn't have a osfamily fact.

I believe Archlinux needs one because of the following:

And because it is 7th with Distrowatch.
It has puppet 3.0.1 and facter 1.6.14 in it Archlinux User Repo:
https://aur.archlinux.org/packages/puppet
https://aur.archlinux.org/packages/facter/

@stschulte
Copy link

@aboe76 is there a specific need for an osfamily fact for ArchLinux? Are there any ArchLinux forks we may want to support later that share enough (e.g. packagenames or package provider) so an osfamiliy fact makes sense?

It would be great if you can squash your two commits and name your commit (#17521) Add osfamily fact ArchLinux (or something compliant with https://github.com/puppetlabs/facter/blob/master/CONTRIBUTING.md) and have an explanation why you think ArchLinux should have its own osfamily fact.

@aboe76
Copy link
Author

aboe76 commented Nov 11, 2012

Updated the pull request, with extra nformation on why archlinux needs an osfamily.

@stschulte
Copy link

@aboe76 Sorry if I wasn't clear but I meant to actually change the commit message not the pull request information (which is only seen in github, but will not appear in the commit history). To be more exact you should be able to do

git checkout osfamily_archlinux
git rebase -i master (if your branch was based of master)

Now you should see an editor with your commits in it. Now squash them all together. This may look like this:

pick b7fb475 added osfamily fact Archlinux modified:   osfamily.rb
squash 07f37d9 added osfamily fact Archlinux modified:   osfamily.rb
squash 89c2099 Refactored osfamily.rb changed tab to spaces removed Archlinux from Redhat family

If you leave the editor you can now update the commit message as I suggested earlier. You should end up with a single commit. You'll then have to do a git push --force to update your branch. The pull request will automatically be updated.

This seems like a lot of hassle but I'm trying to preserve the information that you are the author of the change and at the same time get a commit message that is compliant with the projects guidelines.

	modified:   lib/facter/osfamily.rb
@aboe76
Copy link
Author

aboe76 commented Nov 12, 2012

Ok done, it is no problem, learning git in this way

@stschulte
Copy link

@aboe76 the commit itself looks good now while I think the commit message itself could be improved (it currently only says which file was modified - git can already tell me this if I am interested - and not the intention of the change) but I don't want to be nit-picky.

However if you have rspec and mocha installed you'll notice that your change produces a failing test now when running rake spec

1) OS Family fact should return the kernel fact on operatingsystem Archlinux
 Failure/Error: Facter.fact(:osfamily).value.should == 'random_kernel_fact'
   expected: "random_kernel_fact"
        got: "Archlinux" (using ==)
 # ./spec/unit/osfamily_spec.rb:58:in `block (3 levels) in <top (required)>'

There are two options now:

  1. you can write the test yourself by modifying ./spec/unit/osfamily_spec.rb(this should be pretty much straight forward) and then do a git commit --amend so the logical change and the tests are in the same commit
  2. if you don't want or cannot write the test yourself I'll be happy to do this for you. Its up to you :-)

@aboe76
Copy link
Author

aboe76 commented Nov 12, 2012

Haven't played with spec testing so if you can do it for me that will be
awesome. I understand the need for a unit test.
2012/11/12 Stefan Schulte notifications@github.com

@aboe76 https://github.com/aboe76 the commit itself looks good now
while I think the commit message itself could be improved (it currently
only says which file was modified - git can already tell me this if I am
interested - and not the intention of the change) but I don't want to be
nit-picky.

However if you have rspec and mocha installed you'll notice that your
change produces a failing test now when running rake spec

  1. OS Family fact should return the kernel fact on operatingsystem Archlinux
    Failure/Error: Facter.fact(:osfamily).value.should == 'random_kernel_fact'
    expected: "random_kernel_fact"
    got: "Archlinux" (using ==)

./spec/unit/osfamily_spec.rb:58:in `block (3 levels) in <top (required)>'

There are two options now:

  1. you can write the test yourself by modifying
    ./spec/unit/osfamily_spec.rb(this should be pretty much straight forward)
    and then do a git commit --amend so the logical change and the tests are
    in the same commit
  2. if you don't want or cannot write the test yourself I'll be happy to do
    this for you. Its up to you :-)


Reply to this email directly or view it on GitHubhttps://github.com//pull/352#issuecomment-10305093.

@stschulte
Copy link

merged into 2.x: commit: 1bf8ddf

@stschulte stschulte closed this Nov 14, 2012
florindragos pushed a commit that referenced this pull request Jun 15, 2020
* (FACT-2444) Added alias for bios release date on Debian
* (FACT-2444) Added alias for bios version and vendor on Debian
* (FACT-2444) Added alias for board manufacturer, product and serial_number on Debian
* (FACT-2444) Added aliases for ruby, processors, memory facts on Debian
* (FACT-2444) Added aliases for system_uptime facts on Debian
* (FACT-2444) Extracted the mb converter to a separate facts util.
* (FACT-2444) Added unit tests for when memory resolver returns nil.
Co-authored-by: Andrei Filipovici <andrei.filipovici@andreis-mbp.eth.tsr.corp.puppet.net>
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