-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fixing issues when puppet runs as service #24
base: master
Are you sure you want to change the base?
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
) { | ||
validate_absolute_path($destination) | ||
|
||
if (! $creates and ! $refreshonly and ! $unless){ | ||
fail("Must set one of creates, refreshonly, or unless parameters.\n") | ||
} | ||
|
||
unless( $provider == 'dotnet' or $provider == 'com'){ |
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.
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'){ |
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.
nit: extra space
manifests/unzip.pp
Outdated
|
||
if ($provider == 'dotnet'){ | ||
$command_template = 'windows/unzip_dotnet.ps1.erb' | ||
}else{ |
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.
nit: missing space
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.