def logout_iscsi(portal_address, portal_port, target_iqn):
    utils.execute('iscsiadm',
                  '-m', 'node',
                  '-p', '%s:%s' % (portal_address, portal_port),
                  '-T', target_iqn,
                  '--logout',
                  run_as_root=True,
                  check_exit_code=[0],
                  attempts=5,
                  delay_on_retry=True)
Logout from an iSCSI target.
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/deploy_utils.py/logout_iscsi