1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloud: ovirt: Don't require all iscsi params to be passed to host (#33133)

This commit is contained in:
Ondra Machacek 2017-11-22 19:47:51 +01:00 committed by René Moser
parent 3a6fad38fa
commit e763146f0c
2 changed files with 12 additions and 10 deletions

View file

@ -499,12 +499,13 @@ def main():
)
elif state == 'iscsidiscover':
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=otypes.IscsiDetails(
port=int(module.params['iscsi']['port']) if module.params['iscsi']['port'].isdigit() else None,
username=module.params['iscsi']['username'],
password=module.params['iscsi']['password'],
address=module.params['iscsi']['address'],
port=int(iscsi_param.get('port', 3260)),
username=iscsi_param.get('username'),
password=iscsi_param.get('password'),
address=iscsi_param.get('address'),
),
)
ret = {
@ -514,14 +515,15 @@ def main():
}
elif state == 'iscsilogin':
host_id = get_id_by_name(hosts_service, module.params['name'])
iscsi_param = module.params['iscsi']
ret = hosts_module.action(
action='iscsi_login',
iscsi=otypes.IscsiDetails(
port=int(module.params['iscsi']['port']) if module.params['iscsi']['port'].isdigit() else None,
username=module.params['iscsi']['username'],
password=module.params['iscsi']['password'],
address=module.params['iscsi']['address'],
target=module.params['iscsi']['target'],
port=int(iscsi_param.get('port', 3260)),
username=iscsi_param.get('username'),
password=iscsi_param.get('password'),
address=iscsi_param.get('address'),
target=iscsi_param.get('target'),
),
)
elif state == 'started':

View file

@ -304,7 +304,7 @@ class StorageDomainModule(BaseModule):
otypes.LogicalUnit(
id=lun_id,
address=storage.get('address'),
port=storage.get('port', 3260),
port=int(storage.get('port', 3260)),
target=storage.get('target'),
username=storage.get('username'),
password=storage.get('password'),