HomePhorge

(PUP-3222) Rescue StandardError instead of non-existent exception
c752a9ceea78Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-3222) Rescue StandardError instead of non-existent exception

Previously, the windows service provider rescued exceptions of type
Win32::Service::Error. However, FFI-based versions of win32-service (v0.8.x)
no longer raise that type of error. Instead they raise SystemCallError.

So previously, if puppet failed to manage a service, e.g. service didn't
exist, puppet would try to rescue the exception specifying a class that
was not defined:

puppet resource service foo ensure=stopped
Error: /Service[foo]: Could not evaluate: uninitialized constant Win32::Service::Error

This regression was introduced as part of PUP-1283 when we migrated from
win32-service version 0.7.x to 0.8.x.

This commit modifies the various provider methods to more broadly rescue
StandardErrors and updates the spec tests to handle the negative cases.

Paired-with: Ethan J Brown <ethan@puppetlabs.com>

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU8ffaa4a48325: Merge branch 'pr/3054' into stable
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPUc752a9ceea78: (PUP-3222) Rescue StandardError instead of non-existent exception (authored by Josh Cooper <josh@puppetlabs.com>).Sep 10 2014, 5:58 AM