Skip to content

Az.Ssh Preview 2 #3

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Az.Ssh Preview 2 #3

wants to merge 15 commits into from

Conversation

vthiebaut10
Copy link
Owner

Description

  • Added automated scenario tests for export-azsshconfig
  • Added -Rdp parameter
  • Added support for private clouds ("Microsoft.ConnectedVMwarevSphere/virtualMachines", "Microsoft.ScVmm/virtualMachines","Microsoft.AzureStackHCI/virtualMachines")

Checklist

  • SHOULD select appropriate branch. Cmdlets from Autorest.PowerShell should go to generation branch.
  • SHOULD make the title of PR clear and informative, and in the present imperative tense.
  • SHOULD update ChangeLog.md file(s) appropriately
    • For any service, the ChangeLog.md file can be found at src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
    • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense. Add changelog in description section if PR goes into generation branch.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD have approved design review for the changes in this repository (Microsoft internal only) with following situations
    • Create new module from scratch
    • Create new resource types which are not easy to conform to Azure PowerShell Design Guidelines
    • Create new resource type which name doesn't use module name as prefix
    • Have design question before implementation
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT introduce breaking changes in Az minor release except preview version.
  • SHOULD NOT adjust version of module manually in pull request

sshProcess.StartInfo.RedirectStandardError = true;
sshProcess.Start();

bool sshSuccess = WaitSSHTunnelConnection(sshProcess);

Choose a reason for hiding this comment

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

Should there be a timeout for this connection wait? Can this wait be interrupted with Ctl+C?

Copy link
Owner Author

@vthiebaut10 vthiebaut10 Feb 24, 2023

Choose a reason for hiding this comment

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

Yes, it can be interrupted with a Ctrl+c, and in that case the function returns false and the cmdlet exits. I'm not totally sure if having a timeout is necessary since this function exits once the ssh process exits, and ssh has its own timeout. But I'll look into it and make sure.


if (SshLogsPrinted() || IsDebugMode())
{
var stderr = sshProcess.StandardError;

Choose a reason for hiding this comment

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

Is stderr still valid after the process exits? Can stderr.Readline() throw?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yes, stderr is still valid once the process exits. You can still read any messages that were sent to stderr in between the last time you read stderr and the moment the process exits.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I don't think stderr.Readline() can throw as long as stderr is valid. I can add a check to make sure stderr is not null.

Choose a reason for hiding this comment

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

I believe stderr is a StreamReader, in which case it can throw a IOException exception. Not sure if you want to catch it or let it propagate.

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