##// END OF EJS Templates
automation: use raw strings when there are backslashes...
Gregory Szorc -
r42231:0e9066db default
parent child Browse files
Show More
@@ -118,7 +118,7 b' IAM_INSTANCE_PROFILES = {'
118 # and configure WinRM.
118 # and configure WinRM.
119 # Inspired by the User Data script used by Packer
119 # Inspired by the User Data script used by Packer
120 # (from https://www.packer.io/intro/getting-started/build-image.html).
120 # (from https://www.packer.io/intro/getting-started/build-image.html).
121 WINDOWS_USER_DATA = '''
121 WINDOWS_USER_DATA = r'''
122 <powershell>
122 <powershell>
123
123
124 # TODO enable this once we figure out what is failing.
124 # TODO enable this once we figure out what is failing.
@@ -114,7 +114,7 b' def fix_authorized_keys_permissions(winr'
114 commands = [
114 commands = [
115 '$ErrorActionPreference = "Stop"',
115 '$ErrorActionPreference = "Stop"',
116 'Repair-AuthorizedKeyPermission -FilePath %s -Confirm:$false' % path,
116 'Repair-AuthorizedKeyPermission -FilePath %s -Confirm:$false' % path,
117 'icacls %s /remove:g "NT Service\sshd"' % path,
117 r'icacls %s /remove:g "NT Service\sshd"' % path,
118 ]
118 ]
119
119
120 run_powershell(winrm_client, '\n'.join(commands))
120 run_powershell(winrm_client, '\n'.join(commands))
@@ -192,7 +192,7 b' def find_latest_dist(winrm_client, patte'
192 """Find path to newest file in dist/ directory matching a pattern."""
192 """Find path to newest file in dist/ directory matching a pattern."""
193
193
194 res = winrm_client.execute_ps(
194 res = winrm_client.execute_ps(
195 '$v = Get-ChildItem -Path C:\hgdev\src\dist -Filter "%s" '
195 r'$v = Get-ChildItem -Path C:\hgdev\src\dist -Filter "%s" '
196 '| Sort-Object LastWriteTime -Descending '
196 '| Sort-Object LastWriteTime -Descending '
197 '| Select-Object -First 1\n'
197 '| Select-Object -First 1\n'
198 '$v.name' % pattern
198 '$v.name' % pattern
@@ -270,8 +270,8 b' def run_tests(winrm_client, python_versi'
270 ``test_flags`` is a str representing extra arguments to pass to
270 ``test_flags`` is a str representing extra arguments to pass to
271 ``run-tests.py``.
271 ``run-tests.py``.
272 """
272 """
273 if not re.match('\d\.\d', python_version):
273 if not re.match(r'\d\.\d', python_version):
274 raise ValueError('python_version must be \d.\d; got %s' %
274 raise ValueError(r'python_version must be \d.\d; got %s' %
275 python_version)
275 python_version)
276
276
277 if arch not in ('x86', 'x64'):
277 if arch not in ('x86', 'x64'):
General Comments 0
You need to be logged in to leave comments. Login now