[Kimchi-devel] [PATCH][Kimchi 1/4] Create a single field to pass the installation media

Aline Manera alinefm at linux.vnet.ibm.com
Wed Apr 6 19:03:36 UTC 2016



On 04/06/2016 01:18 AM, Ramon Medeiros wrote:
> Signed-off-by: Ramon Medeiros <ramonn at linux.vnet.ibm.com>
> ---
>   API.json | 9 ++++-----
>   i18n.py  | 2 +-
>   2 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/API.json b/API.json
> index 6f0b484..fe10848 100644
> --- a/API.json
> +++ b/API.json
> @@ -468,11 +468,10 @@
>                       "error": "KCHTMPL0011E"
>                   },
>                   "memory": { "$ref": "#/kimchitype/memory" },
> -                "cdrom": {
> -                    "description": "Path for cdrom",
> -                    "type": "string",
> -                    "pattern": "^((/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*$",
> -                    "error": "KCHTMPL0014E"

PLEASE, also remove the 'base' parameter on 'disks'

> +                "source_media": {
> +                    "description": "Path for installation media (ISO, disk, remote ISO)",
> +                    "type" : "string",
> +                    "pattern" : "^[^ ]+( +[^ ]+)*$"

Also improve the regex to only allow a string starting with /, http, 
https, tftp, ftp or ftps.
And mark source_media as a required parameter.

>                   },
>                   "disks": {
>                       "description": "List of disks",
> diff --git a/i18n.py b/i18n.py
> index 6214687..57b033d 100644
> --- a/i18n.py
> +++ b/i18n.py
> @@ -168,7 +168,7 @@ messages = {
>       "KCHTMPL0013E": _("Amount of memory and maximum memory (MB) must be an integer greater than 512"),
>       "KCHTMPL0014E": _("Template CDROM must be a local or remote ISO file"),
>       "KCHTMPL0015E": _("Invalid storage pool URI %(value)s specified for template"),
> -    "KCHTMPL0016E": _("Specify an ISO image as CDROM or a base image to create a template"),
> +    "KCHTMPL0016E": _("Specify a path to source media (ISO, disk or remote ISO) to create a template"),
>       "KCHTMPL0017E": _("All networks for the template must be specified in a list."),
>       "KCHTMPL0018E": _("Specify a volume to a template when storage pool is iSCSI or SCSI"),
>       "KCHTMPL0019E": _("The volume %(volume)s is not in storage pool %(pool)s"),




More information about the Kimchi-devel mailing list