mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
cloud: ovirt: Don't require all iscsi params to be passed to host (#33133)
This commit is contained in:
parent
3a6fad38fa
commit
e763146f0c
2 changed files with 12 additions and 10 deletions
|
@ -499,12 +499,13 @@ def main():
|
||||||
)
|
)
|
||||||
elif state == 'iscsidiscover':
|
elif state == 'iscsidiscover':
|
||||||
host_id = get_id_by_name(hosts_service, module.params['name'])
|
host_id = get_id_by_name(hosts_service, module.params['name'])
|
||||||
|
iscsi_param = module.params['iscsi']
|
||||||
iscsi_targets = hosts_service.service(host_id).iscsi_discover(
|
iscsi_targets = hosts_service.service(host_id).iscsi_discover(
|
||||||
iscsi=otypes.IscsiDetails(
|
iscsi=otypes.IscsiDetails(
|
||||||
port=int(module.params['iscsi']['port']) if module.params['iscsi']['port'].isdigit() else None,
|
port=int(iscsi_param.get('port', 3260)),
|
||||||
username=module.params['iscsi']['username'],
|
username=iscsi_param.get('username'),
|
||||||
password=module.params['iscsi']['password'],
|
password=iscsi_param.get('password'),
|
||||||
address=module.params['iscsi']['address'],
|
address=iscsi_param.get('address'),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
ret = {
|
ret = {
|
||||||
|
@ -514,14 +515,15 @@ def main():
|
||||||
}
|
}
|
||||||
elif state == 'iscsilogin':
|
elif state == 'iscsilogin':
|
||||||
host_id = get_id_by_name(hosts_service, module.params['name'])
|
host_id = get_id_by_name(hosts_service, module.params['name'])
|
||||||
|
iscsi_param = module.params['iscsi']
|
||||||
ret = hosts_module.action(
|
ret = hosts_module.action(
|
||||||
action='iscsi_login',
|
action='iscsi_login',
|
||||||
iscsi=otypes.IscsiDetails(
|
iscsi=otypes.IscsiDetails(
|
||||||
port=int(module.params['iscsi']['port']) if module.params['iscsi']['port'].isdigit() else None,
|
port=int(iscsi_param.get('port', 3260)),
|
||||||
username=module.params['iscsi']['username'],
|
username=iscsi_param.get('username'),
|
||||||
password=module.params['iscsi']['password'],
|
password=iscsi_param.get('password'),
|
||||||
address=module.params['iscsi']['address'],
|
address=iscsi_param.get('address'),
|
||||||
target=module.params['iscsi']['target'],
|
target=iscsi_param.get('target'),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
elif state == 'started':
|
elif state == 'started':
|
||||||
|
|
|
@ -304,7 +304,7 @@ class StorageDomainModule(BaseModule):
|
||||||
otypes.LogicalUnit(
|
otypes.LogicalUnit(
|
||||||
id=lun_id,
|
id=lun_id,
|
||||||
address=storage.get('address'),
|
address=storage.get('address'),
|
||||||
port=storage.get('port', 3260),
|
port=int(storage.get('port', 3260)),
|
||||||
target=storage.get('target'),
|
target=storage.get('target'),
|
||||||
username=storage.get('username'),
|
username=storage.get('username'),
|
||||||
password=storage.get('password'),
|
password=storage.get('password'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue