(PUP-3939) Sync with upstream OpenBSD rcctl(1) changes#3510
(PUP-3939) Sync with upstream OpenBSD rcctl(1) changes#3510jasperla wants to merge 1 commit intopuppetlabs:masterfrom jasperla:rcctl
Conversation
|
CLA signed by all contributors. |
|
@jasperla Puppet will mixin output = Puppet::Util::Execution.execute(args, :failonfail => false, :combine => false) ... if output.exitstatus == 100 Hope that helps! |
|
Thanks for the hint about In a regular shell: % rcctl get sshd status ; echo $?
0
% rcctl get iked status ; echo $?
1
%So Puppet does the right thing and knows when it's enabled and when it's not: However it seems when the code is called from rspec it suddenly breaks? Looking at the current failure, |
|
I've so far been unable to fix this myself, and help would be greatly appreciated or Puppet 4 won't be able to manage any services on OpenBSD :( |
|
Hi, thanks for that. The changes are not quite backwards compatible as rcctl's changes are not as well. rcctl has not been in a proper OpenBSD release yet so I don't think that's too much of an issue right now. |
|
@jasperla ok, it sounds then like what should happen is the provider and spec should be updated to branch on the version of openbsd that the new interface will be the default for, and we should keep the old commands to be the default when the older variant of rcctl is used. Also, the spec files in master have recently been updated to use the syntax in rspec v3, so I'm getting merge conflicts trying to cherry-pick these changes into an updated test branch I'm working from. Can you clean up those conflicts and add the appropriate branching in the provider & spec? |
|
@ScottGarman well, both checks will be for OpenBSD 5.7 then since rcctl itself was introduced after OpenBSD 5.6 was released and will thus first appear in OpenBSD 5.7. So in my opinion it's not quite needed to bother with backwards compat. |
|
The merge errors have been resolved now, |
|
@jasperla thanks for your patience - I've fixed up the rspec test and updated the commit message in a new PR-3663. I'll close out this PR in favor of the new one. Since I made a trivial change to the provider code, could I ask you one last time to test the new PR and add a comment to it with the results of your testing? Thanks! |
The
rcctl(1)tool recently changed the interface to use it; this PR puts Puppet back in sync.Everything works, however there's one spec failure that I don't understand:
Looking at the relevant code:
So the way the
rcctl get sshdshould work is return1if the service is not enabled, and0otherwise. It's now implemented as abegin/rescue/elseblock, but that doesn't seem to do the trick.Could someone help me to get this sorted, or to let me know how to have
execute()save the return code?