-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new structured facts for gluster_peers
and gluster_volumes
#186
Conversation
This pull request replaces my previous one that ended up being a complete mess of commits. I'm apparently not great with Git :) |
Hi @tparkercbn, thanks for the PR. Can you please add a test test for the changes? |
I have no idea how to do that :) Let me see what I can figure out. |
Are there any current tests for the output of the facts? My code makes no changes at all to the functionality of the module itself other than fixing the comma separated values bug in the volume options |
@tparkercbn Would some examples help? https://github.com/voxpupuli/puppet-nginx/blob/master/spec/unit/facter/util/fact_nginx_version_spec.rb If you're really stuck, let us know. |
Thanks! That should help a ton! |
I am going to be on a business trip for a few weeks and cannot get the spec tests running on my laptop (X crashes when I start the container). I will try to get a test server running when I have some time but the test suite may take a but more time than I hoped. |
Docker + systemd + Xorg are sometimes complicated. It is totally fine to just push changes and watch the outcome on travis. It will execute the tests for you. You just need to squash the git history afterwards. |
Ok cool. I was hoping to be able to learn a bit more about the tests before making my code public :D but that's what I will do.
Thanks!
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Tim Meusel <notifications@github.com>
Sent: Wednesday, November 28, 2018 2:15:06 PM
To: voxpupuli/puppet-gluster
Cc: Tom Parker; Mention
Subject: Re: [voxpupuli/puppet-gluster] Created new structured facts for gluster_peers and gluster_volumes us… (#186)
Docker + systemd + Xorg are sometimes complicated. It is totally fine to just push changes and watch the outcome on travis. It will execute the tests for you. You just need to squash the git history afterwards.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#186 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AFOC9iFiJ2erEwmDPGJCdAVuM_vqlBWdks5uzu7KgaJpZM4YxQfa>.
|
gluster_peers
and gluster_volumes
gluster_peers
and gluster_volumes
gluster_peers
and gluster_volumes
} | ||
end | ||
|
||
gluster_peers = {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can specify hashes inline:
{
"peer2" => {
"uuid" => "7d1148a2-f19e-4f18-818f-3396ddf38c30",
"connected" => 1,
"state" => 3,
"status" => "Peer in Cluster",
},
"peer3" => {
"uuid" => "35f53c52-83dc-4100-a1f7-4a7cdeee074d",
"connected" => 1,
"state" => 3,
"status" => "Peer in Cluster",
},
}
Possibly Rubocop has something about this, but the idea is clear I hope ;)
Sorry. I haven't forgotten about this but work and travel has had me up to my eyeballs. For some reason it's not finding the data that I am passing to validate. Is there someone who can take a look and make some suggestions? Thanks! Tom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tparkercbn, have a couple of patches.
-
For lib/facter/gluster.rb.
I think it is better to take out the facts the "gluster_peers" and the "gluster_volumes" from the "unless".
At a minimum, gluster_peers may contain data when the volume is missing. -
I corrected the fact_gluster_peers_spec.rb. (coverage 94.12%). It is performed successfully only if the first patch is applied (see above 1.)
It would also be more logical if the file were located along the path spec/unit/lib/facter/gluster_spec.rb.
Putting patches on both changes:
You can apply fixes by placing them in the root of the repository and running the commands:
git apply gluster.rb.patch.txt
git apply gluster_spec.rb.patch.txt
I would like to send a "pull request" to your "pull request", but it is not clear how to do this.
This is awesome! Thanks 😊
I applied the patches and pushed the change but we are failing the rubocop checks in travis-ci
I’m not sure how to properly give you credit for this work. Maybe someone else on the team knows
Tom
From: tryfunc <notifications@github.com>
Sent: Thursday, July 18, 2019 1:17 AM
To: voxpupuli/puppet-gluster <puppet-gluster@noreply.github.com>
Cc: Tom Parker <tparker@cbnco.com>; Mention <mention@noreply.github.com>
Subject: Re: [voxpupuli/puppet-gluster] WIP Create new structured facts for `gluster_peers` and `gluster_volumes` (#186)
@tryfunc requested changes on this pull request.
Hi @tparkercbn<https://github.com/tparkercbn>, have a couple of patches.
1. For lib/facter/gluster.rb.
I think it is better to take out the facts the "gluster_peers" and the "gluster_volumes" from the "unless".
At a minimum, gluster_peers may contain data when the volume is missing.
2. I corrected the fact_gluster_peers_spec.rb. (coverage 94.12%). It is performed successfully only if the first patch is applied (see above 1.)
It would also be more logical if the file were located along the path spec/unit/lib/facter/gluster_spec.rb.
Putting patches on both changes:
1. gluster.rb.patch.txt<https://github.com/voxpupuli/puppet-gluster/files/3404824/gluster.rb.patch.txt>
2. gluster_spec.rb.patch.txt<https://github.com/voxpupuli/puppet-gluster/files/3404825/gluster_spec.rb.patch.txt>
You can apply fixes by placing them in the root of the repository and running the commands:
git apply gluster.rb.patch.txt
git apply gluster_spec.rb.patch.txt
I would like to send a "pull request" to your "pull request", but it is not clear how to do this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#186?email_source=notifications&email_token=ABJYF5SEJ3G5LPVKLHVDV4LP774FXA5CNFSM4GGFA7NKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6Z2YPA#pullrequestreview-263433276>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABJYF5QO6YZR3KXLONU2T2DP774FXANCNFSM4GGFA7NA>.
|
Cool! Thank! Oh, one test failed. Not quite the correct syntax. Now I will fix it. |
Yeah, I just stashed them there and then forgot to remove before commit. Still on my first coffee 😊
I was going to try to cleanup the indenting but you are probably faster 😊
Tom
From: tryfunc <notifications@github.com>
Sent: Thursday, July 18, 2019 11:31 AM
To: voxpupuli/puppet-gluster <puppet-gluster@noreply.github.com>
Cc: Tom Parker <tparker@cbnco.com>; Mention <mention@noreply.github.com>
Subject: Re: [voxpupuli/puppet-gluster] WIP Create new structured facts for `gluster_peers` and `gluster_volumes` (#186)
Cool! Thank!
One caveat, the gluster.rb.patch.txt and gluster_spec.rb.patch.txt patch files are not needed in the repository. It would be better to remove them.
Oh, one test failed. Not quite the correct syntax. Now I will fix it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#186?email_source=notifications&email_token=ABJYF5R3PELLR5TTVMA7EVDQACEDPA5CNFSM4GGFA7NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2I3UMA#issuecomment-512866864>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABJYF5UH74M5D6EBPV23QKTQACEDPANCNFSM4GGFA7NA>.
|
Attached is the revised version of gluster _spec.rb. Checked several times - everything is ok. |
Thank you.
All tests look good!
Now I will have to figure out how to rebase this all on master so it’s not a mess of commits 😊
I really appreciate your help on this. I am still very new to rspec testing
Tom
From: tryfunc <notifications@github.com>
Sent: Thursday, July 18, 2019 2:25 PM
To: voxpupuli/puppet-gluster <puppet-gluster@noreply.github.com>
Cc: Tom Parker <tparker@cbnco.com>; Mention <mention@noreply.github.com>
Subject: Re: [voxpupuli/puppet-gluster] WIP Create new structured facts for `gluster_peers` and `gluster_volumes` (#186)
Attached is the revised version of gluster _spec.rb. Checked several times - everything is ok.
gluster_spec.rb.txt<https://github.com/voxpupuli/puppet-gluster/files/3407901/gluster_spec.rb.txt>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#186?email_source=notifications&email_token=ABJYF5X7ZDQRYSK6RILCSHLQACYRPA5CNFSM4GGFA7NKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2JLR5Y#issuecomment-512932087>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABJYF5RGI7YWGAGFSSPIID3QACYRPANCNFSM4GGFA7NA>.
|
Hey @tparkercbn. If you need some help with rebasing you can ping us in our IRC channel #voxpupuli on freenode or on https://slack.puppet.com/ |
e9b5c19
to
3b61608
Compare
gluster_peers
and gluster_volumes
gluster_peers
and gluster_volumes
…ing the --xml cli modifier. All legacy facts are unchanged to not cause any breaking changes to people who may be using them Special thanks to @tryfunc for the help with the spec tests.
ff5e334
to
a56abdf
Compare
Created new structured facts for gluster_peers and gluster_volumes using the --xml cli modifier.
All legacy facts are unchanged to not cause any breaking changes to people who may be using them
Pull Request (PR) description
Created new structured facts for gluster_peers and gluster_volumes that fix the problems caused by comma separated data structures containing comma separated values. It also fixes the gluster_volume_ports bug when the volume names line wrap
This Pull Request (PR) fixes the following issues
Fixes #165
Fixes #53
Fixes #33