Fixing issues when puppet runs as service#24
Fixing issues when puppet runs as service#24Vizibirka wants to merge 3 commits intocounsyl:masterfrom
Conversation
If puppet runs as service the following exceptions are raised: The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)) You cannot call a method on a null-valued expression. Surrunded the method with try-catch and added better error handling logic Added a "virtual" provider and .NET based method, which is available from windows .NET 4.5 (Windows 8) and made it default. But left the original as a fallback.
manifests/unzip.pp
Outdated
| fail("Must set one of creates, refreshonly, or unless parameters.\n") | ||
| } | ||
|
|
||
| unless( $provider == 'dotnet' or $provider == 'com'){ |
There was a problem hiding this comment.
What happened to the old default of powershell? Should that be supported for backwards compatibility?
Also, some funky spacing in this line.
manifests/unzip.pp
Outdated
| fail("Wrong provider: `${provider}', choices are: dotnet or com!\n") | ||
| } | ||
|
|
||
| if ($provider == 'dotnet'){ |
manifests/unzip.pp
Outdated
|
|
||
| if ($provider == 'dotnet'){ | ||
| $command_template = 'windows/unzip_dotnet.ps1.erb' | ||
| }else{ |
|
Based on your observations, I fixed spacing plus extended the readme. How do you mean by 'What happened to the old default of powershell? Should that be supported for backwards compatibility?' Powershell is still there and does the job. I just extended the parameters' validation because if you run the following code against your original code it'll be green instead of failing. windows::unzip { '\server.which.does\not\exists.zip': |
Thinking about this some more, I have two points:
|
|
I see. I thought about and I your're right, we should keep powershell as the provider and a new property should be added for fallbacking to your original implementation. I'll create another pull request |
… deployments. Modified readme to match with the ipmlementation.
If puppet runs as service the following exceptions are raised:
The server threw an exception. (Exception from HRESULT: 0x80010105
(RPC_E_SERVERFAULT))
You cannot call a method on a null-valued expression.
Surrunded the method with try-catch and added better error handling
logic
Added a "virtual" provider and .NET based method, which is available
from windows .NET 4.5 (Windows 8) and made it default.
But left the original as a fallback.