mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-11 16:44:22 -07:00
open_iscsi: command args as list rather than string (#10599)
* open_iscsi: command args as list rather than string * add changelog frag
This commit is contained in:
parent
6b7ec5648d
commit
1bd7aac07e
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/10599-open-iscsi-cmd-list.yml
Normal file
2
changelogs/fragments/10599-open-iscsi-cmd-list.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- open_iscsi - using safer mechanism to run external command (https://github.com/ansible-collections/community.general/pull/10599).
|
|
@ -242,7 +242,7 @@ def target_login(module, target, check_rc, portal=None, port=None):
|
||||||
params = [('node.session.auth.username_in', node_user_in),
|
params = [('node.session.auth.username_in', node_user_in),
|
||||||
('node.session.auth.password_in', node_pass_in)]
|
('node.session.auth.password_in', node_pass_in)]
|
||||||
for (name, value) in params:
|
for (name, value) in params:
|
||||||
cmd = '%s --mode node --targetname %s --op=update --name %s --value %s' % (iscsiadm_cmd, target, name, value)
|
cmd = [iscsiadm_cmd, '--mode', 'node', '--targetname', target, '--op=update', '--name', name, '--value', value]
|
||||||
module.run_command(cmd, check_rc=check_rc)
|
module.run_command(cmd, check_rc=check_rc)
|
||||||
|
|
||||||
cmd = [iscsiadm_cmd, '--mode', 'node', '--targetname', target, '--login']
|
cmd = [iscsiadm_cmd, '--mode', 'node', '--targetname', target, '--login']
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue