Re: [PATCH] nwfiler: Return error message about unresolvable variables

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

 



On 06/27/2011 08:14 AM, Stefan Berger wrote:

s/nwfiler/nwfilter/ in the subject

> This is in response to bugzilla 664629
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=664629
> 
> The patch below returns an appropriate error message if the chain of
> nwfilters is found to contain unresolvable variables and therefore
> cannot be instantiated.
> 
> +
> +static void
> +_printString(void *payload ATTRIBUTE_UNUSED, const void *name, void *data)

I'm not a fan of leading underscore.  That shouldn't be necessary -
marking the function static is good enough without having to also munge
the name.  s/_printString/printString/g

> +/**
> + * virNWFilterPrintVars
> + *
> + * @var: hash table containing variables
> + * @separaptro: separator to use between variable names, i.e., ", "

s/separaptro/separator/

> +err_unresolvable_vars:
> +
> +    buf = virNWFilterPrintVars(missing_vars->hashTable, ", ", false, false);
> +    if (buf) {
> +        virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
> +                   _("Cannot instantiate filter due to unresolvable "
> +                     "variable%s: %s"),
> +                   strstr(buf, ", ") ? "s" : "",

This is unfair to translators.  Appending 's' is not always the proper
way to create a plural.  Rather, you must use:

> +                   buf);

virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
                       strstr(buf, ", ") ?
 _("Cannot instantiate filter due to unresolvable variables: %s") :
 _("Cannot instantiate filter due to unresolvable variable: %s"),
                       buf);

ACK with those changes.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[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]