changeset 42661:e91930d712e8 stable 5.1

automation: execute powershell when connecting For some reason, the ability to execute PS scripts appears to come online after the ability to execute regular command scripts. This is creating race conditions when connecting to instances resulting in our wait_for_winrm() returning before PS is available leading to an exception being thrown in other code. Let's change the client connection code to execute a minimal PS script so we can try to trap the exception in wait_for_winrm().
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 28 Jul 2019 18:32:31 -0700
parents 24cd5b0ba5b3
children a218850cd52c
files contrib/automation/hgautomation/winrm.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/automation/hgautomation/winrm.py	Sun Jul 28 18:16:08 2019 -0700
+++ b/contrib/automation/hgautomation/winrm.py	Sun Jul 28 18:32:31 2019 -0700
@@ -37,7 +37,7 @@
         try:
             client = Client(host, username=username, password=password,
                             ssl=ssl, connection_timeout=5)
-            client.execute_cmd('echo "hello world"')
+            client.execute_ps("Write-Host 'Hello, World!'")
             return client
         except requests.exceptions.ConnectionError:
             if time.time() >= end_time: