Re: [PATCH RESEND v3 4/8] meson: move iscsiadm check into storage_iscsi condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 25, 2021 at 10:00:43AM +0200, Pavel Hrdina wrote:
> +  if not get_option('storage_iscsi').disabled()
> +    iscsi_enable = true
> +    iscsiadm_prog = find_program('iscsiadm', required: false, dirs: libvirt_sbin_path)
> +
> +    if not iscsiadm_prog.found()
> +      if get_option('storage_iscsi').enabled()
> +        error('We need iscsiadm for iSCSI storage driver')
> +      else
> +        iscsi_enable = false
> +      endif
> +    endif

I believe this could be rewritten as

  if not get_option('storage_iscsi').disabled()
    iscsi_enable = true
    iscsiadm_prog = find_program('iscsiadm', required:
get_option('storage_iscsi'), dirs: libvirt_sbin_path)

    if not iscsiadm_prog.found()
      iscsi_enable = false
    endif

I see this pattern used elsewhere in the file and it's more concise
while achieving the same result AFAICT.

-- 
Andrea Bolognani / Red Hat / Virtualization




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux