Issue #18021 has been updated by eric sorenson.
Status changed from Unreviewed to Tests Insufficient
Assignee set to Amos Shapira
Hi Amos, I see that finch responded on github; pasting the response here as
well. If you can either fix the failing test or ask for help on #puppet-dev, we
can include this contribution in Puppet. Thanks!
Thank you for this contribution!
While running the tests, I noticed the following failures. Unfortunately, we're
not able to merge this change set into the code base if the change causes other
example behaviors to fail.
<pre>
1) Puppet::Type::Service::ProviderDaemontools when restarting should use 'svc'
to restart the service
Failure/Error: @provider.restart
Mocha::ExpectationError:
unexpected invocation: #.fail('Could not restart Service[myservice]:
Execution of ' -t /etc/service/myservice' returned 1: ')
unsatisfied expectations:
- expected exactly once, not yet invoked: #.svc('-t',
'/etc/service/myservice')
satisfied expectations:
</pre>
The failing expectation, at
https://github.com/puppetlabs/puppet/blob/master/spec/unit/provider/service/daemontools_spec.rb#L95
, is relying on the old behavior of the restart method. The change from
restart to restartcmd means that
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/service/service.rb#L9
will be invoked instead. Therefore, instead of doing
provider.expects(:restart) the example should be something like
https://github.com/puppetlabs/puppet/blob/master/spec/unit/provider/service/smf_spec.rb#L108
.
Examples exercising these behavior changes need to be included in the change
set before we merge this contribution in. If you're not comfortable adding
RSpec examples, I'm happy to help out. I'm finch in #puppet-dev on freenode.
Please include examples that will automatically let us know if this problem
resurfaces in the future, otherwise we may have a regression as we continue to
make changes over time.
----------------------------------------
Bug #18021: daemontools service provider ignores "restart" command
https://projects.puppetlabs.com/issues/18021#change-84059
Author: Amos Shapira
Status: Tests Insufficient
Priority: Normal
Assignee: Amos Shapira
Category: provider
Target version:
Affected Puppet version: 2.7.20
Keywords: daemontools
Branch:
Hello,
(I submitted this on puppet-users Google group without response and think that
I found a bug, so I'm copying here):
Hello,
Using Puppet 2.7(.20), I'm trying to override the "restart" command of a
service controlled by daemontools provider using:
service { 'bamboo-agent':
hasrestart => false,
provider => 'daemontools',
restart => '/bin/touch /var/run/needs-restart',
...
}
And
...
notify => Service['bamboo-agent']
...
But the service keeps being restarted using "svc -t ..."
As far as I follow the documents this is supposed to work
(http://docs.puppetlabs.com/references/2.7.latest/type.html#service)
but as far as I follow the code in
puppet-2.7.20/lib/puppet/provider/service/daemontools.rb it's not supported:
def restart
svc "-t", self.service
end
(i.e. not looking at restartcmd)
Am I missing something or is it a bug?
How can I get it to work with Puppet 2.7?
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.