[Kimchi-devel] [PATCH 2/4] Provide a meaningful message to WOKUTILS0001E

Paulo Ricardo Paz Vital pvital at linux.vnet.ibm.com
Tue Oct 20 16:31:18 UTC 2015


Reviewed-By: Paulo Vital <pvital at linux.vnet.ibm.com>

On Mon, 2015-10-19 at 19:10 -0200, Aline Manera wrote:
> WOKUTILS0001E is used to tell user a URL is not reachable so do it in
> a
> better way.
> 
> Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
> ---
>  src/wok/i18n.py  | 2 +-
>  src/wok/utils.py | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/wok/i18n.py b/src/wok/i18n.py
> index ad3ea9f..785c82a 100644
> --- a/src/wok/i18n.py
> +++ b/src/wok/i18n.py
> @@ -45,7 +45,7 @@ messages = {
> 
>      "WOKOBJST0001E": _("Unable to find %(item)s in datastore"),
> 
> -    "WOKUTILS0001E": _("Invalid URI %(uri)s"),
> +    "WOKUTILS0001E": _("Unable to reach %(url)s. Make sure it is
> accessible and try again."),
>      "WOKUTILS0002E": _("Timeout while running command '%(cmd)s'
> after %(seconds)s seconds"),
>      "WOKUTILS0004E": _("Invalid data value '%(value)s'"),
>      "WOKUTILS0005E": _("Invalid data unit '%(unit)s'"),
> diff --git a/src/wok/utils.py b/src/wok/utils.py
> index 9f96e57..b426dfe 100644
> --- a/src/wok/utils.py
> +++ b/src/wok/utils.py
> @@ -315,10 +315,10 @@ def validate_repo_url(url):
> 
>      if url_parts[0] in ['http', 'https', 'ftp']:
>          if not check_url_path(url):
> -            raise InvalidParameter("WOKUTILS0001E", {'uri': url})
> +            raise InvalidParameter("WOKUTILS0001E", {'url': url})
>      elif url_parts[0] == 'file':
>          if not os.path.exists(url_parts[1]):
> -            raise InvalidParameter("WOKUTILS0001E", {'uri': url})
> +            raise InvalidParameter("WOKUTILS0001E", {'url': url})
>      else:
>          raise InvalidParameter("KCHREPOS0002E")
> 




More information about the Kimchi-devel mailing list