[virt-tools-list] [PATCH] Remove formatting character for empty string

Cole Robinson crobinso at redhat.com
Thu Sep 1 17:14:29 UTC 2011


On 08/11/2011 02:26 PM, Guido Günther wrote:
> Avoids printing '%s' as seen when trying to create a new vm in
> virt-manager with an empty hostname.
> 
> ---
>  virtinst/_util.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/virtinst/_util.py b/virtinst/_util.py
> index e7e3e7f..d7edd94 100644
> --- a/virtinst/_util.py
> +++ b/virtinst/_util.py
> @@ -152,7 +152,7 @@ def validate_uuid(val):
>  
>  def validate_name(name_type, val, lencheck=False):
>      if type(val) is not str or len(val) == 0:
> -        raise ValueError(_("%s name must be a string"))
> +        raise ValueError(_("name must be a string"))
>  
>      if lencheck:
>          if len(val) > 50:

Thanks for the patch, but we actually want to show name_type in the
error. I've committed that change:

http://git.fedorahosted.org/git?p=python-virtinst.git;a=commit;h=72de7f4fba5e3536a0b68a23473ca9c81869882f

- Cole




More information about the virt-tools-list mailing list