Skip to content

Name Powershell Script and Log Files Uniquely#6

Merged
mwrock merged 1 commit intoWinRb:masterfrom
jerryk55:concurrent_file_naming
Mar 30, 2016
Merged

Name Powershell Script and Log Files Uniquely#6
mwrock merged 1 commit intoWinRb:masterfrom
jerryk55:concurrent_file_naming

Conversation

@jerryk55
Copy link
Copy Markdown
Contributor

In order to allow winrm-elevated to run concurrently against the
same Windows server, name the powershell script uploaded to the server
using a randomly generated UUID.

In addition, the logfiles generated by the script will be named using the
pid of the script's running process.

We will clean up the logfiles when the script is finished. Since the same
script can be uploaded once and invoked multiple times it will be left intact.

The intent here is to deal with the issue described here: #5

@mwrock @sneal if you could review and possibly merge when possible that would be great.
Open for discussion of course. Thanks!

Comment thread lib/winrm-elevated/runner.rb Outdated
#
# @return [Hash] :stdout and :stderr
#
# @return [Hash] :stdout and :stderr
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was an accident, which reminds I should probably enable RuboCop on this project and add an automated build.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Fixing.
@sneal - pushed with the fix.

@jerryk55 jerryk55 force-pushed the concurrent_file_naming branch from c1f1ada to 11220fa Compare March 30, 2016 13:32
In order to allow winrm-elevated to run concurrently against the
same Windows server, name the powershell script uploaded to the server
using a randomly generated UUID.

In addition, the logfiles generated by the script will be named using the
GetTempFileName to ensure uniqueness.

We will clean up the logfiles when the script is finished. Since the same
script can be uploaded once and invoked multiple times it will be left intact.
@jerryk55 jerryk55 force-pushed the concurrent_file_naming branch from 11220fa to fad4e00 Compare March 30, 2016 14:02
@sneal
Copy link
Copy Markdown
Member

sneal commented Mar 30, 2016

LGTM. I think we can cross the debugging bridge when we need. Perhaps we look for an environment variable, when set we skip the log deletion.

@mwrock
Copy link
Copy Markdown
Member

mwrock commented Mar 30, 2016

👍 yeaah I wouldn't worry about the debug scenario

@mwrock mwrock merged commit 98427da into WinRb:master Mar 30, 2016
@mwrock
Copy link
Copy Markdown
Member

mwrock commented Mar 30, 2016

tests work on my machine.

@jerryk55
Copy link
Copy Markdown
Contributor Author

Thanks guys. Will this be 0.3.0?

@mwrock
Copy link
Copy Markdown
Member

mwrock commented Mar 31, 2016

yup. released!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants