Skip to content

Commit 04f1afc

Browse files
authored
[Windows Remote Management] MyPy In Docker (demisto#37919)
* mypy * RN * pylint
1 parent dd9280d commit 04f1afc

File tree

4 files changed

+29
-22
lines changed

4 files changed

+29
-22
lines changed

Packs/WinRM/Integrations/WindowsRemoteManagement/WindowsRemoteManagement.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from CommonServerUserPython import *
44

55
import winrm
6-
6+
from winrm import Session
77

88
''' Helper functions '''
99

1010

11-
class Client(object):
11+
class Client:
1212
def __init__(self, username, password, auth_type, realm, default_host, decode):
1313
self.username = username
1414
self.password = password
@@ -23,6 +23,7 @@ def __init__(self, username, password, auth_type, realm, default_host, decode):
2323
self.res = None
2424

2525
def run(self):
26+
s: Session
2627
if self.auth == "ntlm":
2728
s = winrm.Session(
2829
target=self.hostname,
@@ -38,10 +39,10 @@ def run(self):
3839
)
3940

4041
if self.runType == 'Process':
41-
self.res = s.run_cmd(self.command, self.arguments)
42+
self.res = s.run_cmd(self.command, self.arguments) # type: ignore[arg-type]
4243

4344
elif self.runType == 'Script':
44-
self.res = s.run_ps(self.script)
45+
self.res = s.run_ps(self.script) # type: ignore[arg-type]
4546

4647
def output(self):
4748
entry_context = None

Packs/WinRM/Integrations/WindowsRemoteManagement/WindowsRemoteManagement.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ script:
128128
description: The hostname to run the command on. This will override the default hostname specified in the instance.
129129
- name: command
130130
required: true
131-
description: Command to execute
131+
description: Command to execute.
132132
- name: arguments
133-
description: Comma separate list of arguments
133+
description: Comma separate list of arguments.
134134
- name: decode
135135
auto: PREDEFINED
136136
predefined:
@@ -219,28 +219,28 @@ script:
219219
- utf_16_le
220220
- utf_7
221221
- utf_8
222-
description: Decode codec to use when decoding command outputs (overrides value set in the instance)
222+
description: Decode codec to use when decoding command outputs (overrides value set in the instance).
223223
outputs:
224224
- contextPath: WinRM.Process
225-
description: Process object of the WinRM command
225+
description: Process object of the WinRM command.
226226
- contextPath: WinRM.Process.Output
227-
description: STDOUT of the WinRM command
227+
description: STDOUT of the WinRM command.
228228
- contextPath: WinRM.Process.Error
229-
description: STDERR of the WinRM command
229+
description: STDERR of the WinRM command.
230230
- contextPath: WinRM.Process.Status
231-
description: Status code of the WInRM command
232-
description: Executes a command on the host
231+
description: Status code of the WInRM command.
232+
description: Executes a command on the host.
233233
execution: true
234234
- name: winrm-run-powershell
235235
arguments:
236236
- name: hostname
237237
description: The hostname to run the command on. This will override the default hostname specified in the instance.
238238
- name: entryID
239-
description: The entry ID of the powershell script to run (overrides scriptname and script)
239+
description: The entry ID of the powershell script to run (overrides scriptname and script).
240240
- name: script
241-
description: The powershell script to execute (requires code, not a file input)
241+
description: The powershell script to execute (requires code, not a file input).
242242
- name: scriptname
243-
description: Name of the script (optional)
243+
description: Name of the script (optional).
244244
- name: decode
245245
auto: PREDEFINED
246246
predefined:
@@ -329,16 +329,16 @@ script:
329329
- utf_16_le
330330
- utf_7
331331
- utf_8
332-
description: Decode codec to use when decoding command outputs (overrides value set in the instance)
332+
description: Decode codec to use when decoding command outputs (overrides value set in the instance).
333333
outputs:
334334
- contextPath: WinRM.Powershell.Output
335-
description: STDOUT of the WinRM command
335+
description: STDOUT of the WinRM command.
336336
- contextPath: WinRM.Powershell.Error
337-
description: STDERR of the WinRM command
337+
description: STDERR of the WinRM command.
338338
- contextPath: WinRM.Powershell.Status
339-
description: Status code of the WInRM command
340-
description: Executes a Powershell script on the endpoint
341-
dockerimage: demisto/auth-utils:1.0.0.115527
339+
description: Status code of the WInRM command.
340+
description: Executes a Powershell script on the endpoint.
341+
dockerimage: demisto/auth-utils:1.0.0.1839651
342342
subtype: python3
343343
fromversion: 5.0.0
344344
tests:

Packs/WinRM/ReleaseNotes/1_0_6.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#### Integrations
3+
4+
##### Windows Remote Management (Beta)
5+
6+
Updated the Docker image to: *demisto/auth-utils:1.0.0.1839651*.

Packs/WinRM/pack_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "Windows Remote Management",
33
"description": "Uses the Python pywinrm library and commands to execute either a process or using Powershell scripts.",
44
"support": "xsoar",
5-
"currentVersion": "1.0.5",
5+
"currentVersion": "1.0.6",
66
"author": "Cortex XSOAR",
77
"url": "https://www.paloaltonetworks.com/cortex",
88
"email": "",

0 commit comments

Comments
 (0)