[Kimchi-devel] [PATCH 1/5] CDROM Management: API.md and externalized error messages

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Fri Feb 14 17:50:30 UTC 2014


Reviewed-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>

On 02/14/2014 03:26 PM, Aline Manera wrote:
> From: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
>
> This patch changes API.md with new storage sub-collection/sub-resource
> information.
>
> Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
> Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
>
> Excluding hard drive support from docs/API.md
> Adding externalized string to be used in the new exception
> model
>
> Signed-off-by: Daniel Henrique Barboza <danielhb at linux.vnet.ibm.com>
> ---
>   docs/API.md        |   21 ++++++++++++++++
>   po/en_US.po        |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++--
>   po/kimchi.pot      |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++--
>   po/pt_BR.po        |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++--
>   po/zh_CN.po        |   70 ++++++++++++++++++++++++++++++++++++++++++++++++++--
>   src/kimchi/i18n.py |   12 +++++++++
>   6 files changed, 305 insertions(+), 8 deletions(-)
>
> diff --git a/docs/API.md b/docs/API.md
> index 89acd44..2b60d52 100644
> --- a/docs/API.md
> +++ b/docs/API.md
> @@ -117,6 +117,27 @@ Represents a snapshot of the Virtual Machine's primary monitor.
>   
>   * **GET**: Redirect to the latest screenshot of a Virtual Machine in PNG format
>   
> +
> +### Sub-collection: Virtual Machine storages
> +**URI:** /vms/*:name*/storages
> +* **GET**: Retrieve a summarized list of all storages of specified guest
> +* **POST**: Attach a new storage or virtual drive to specified virtual machine.
> +    * dev: The name of the storage in the vm.
> +    * type: The type of the storage (currently supports  'cdrom' only).
> +    * path: Path of cdrom iso.
> +
> +### Sub-resource: storage
> +**URI:** /vms/*:name*/storages/*:dev*
> +* **GET**: Retrieve storage information
> +    * dev: The name of the storage in the vm.
> +    * type: The type of the storage ('cdrom' only for now).
> +    * path: Path of cdrom iso.
> +* **PUT**: Update storage information
> +    * path: Path of cdrom iso. Can not be blank.
> +* **DELETE**: Remove the storage.
> +
> +
> +
>   ### Collection: Templates
>   
>   **URI:** /templates
> diff --git a/po/en_US.po b/po/en_US.po
> index 5a5327a..0688c75 100644
> --- a/po/en_US.po
> +++ b/po/en_US.po
> @@ -6,7 +6,7 @@ msgid ""
>   msgstr ""
>   "Project-Id-Version: kimchi 0.1\n"
>   "Report-Msgid-Bugs-To: \n"
> -"POT-Creation-Date: 2014-02-11 15:02-0200\n"
> +"POT-Creation-Date: 2014-02-14 13:34-0200\n"
>   "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>   "Last-Translator: Crístian Viana <vianac at linux.vnet.ibm.com>\n"
>   "Language-Team: English\n"
> @@ -728,6 +728,13 @@ msgstr ""
>   msgid "Specify a template to create a virtual machine from"
>   msgstr ""
>   
> +msgid "Volume list (LUNs names) not given."
> +msgstr ""
> +
> +msgid ""
> +"Virtual machine volumes must be a list of strings with distinct LUNs names."
> +msgstr ""
> +
>   #, python-format
>   msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
>   msgstr ""
> @@ -909,6 +916,22 @@ msgid "Specify name and type to create a storage pool"
>   msgstr ""
>   
>   #, python-format
> +msgid ""
> +"%(disk)s is not a valid disk/partition. Could not add it to the pool "
> +"%(pool)s."
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while extending logical pool %(pool)s. Details: %(err)s"
> +msgstr ""
> +
> +msgid "The parameter disks only can be updated for logical storage pool."
> +msgstr ""
> +
> +msgid "The SCSI host adapter name must be a string."
> +msgstr ""
> +
> +#, python-format
>   msgid "Storage volume %(name)s already exists"
>   msgstr ""
>   
> @@ -1034,7 +1057,7 @@ msgid "Unable to create debug report %(name)s. Details: %(err)s."
>   msgstr ""
>   
>   #, python-format
> -msgid "Can not find generated debug report named %(name)s"
> +msgid "Can not find any generated debug report matching name %(name)s"
>   msgstr ""
>   
>   #, python-format
> @@ -1060,6 +1083,10 @@ msgid "Unable to reboot host machine as there are running virtual machines"
>   msgstr ""
>   
>   #, python-format
> +msgid "Node device '%(name)s' not found"
> +msgstr ""
> +
> +#, python-format
>   msgid "Unable to find %(item)s in datastore"
>   msgstr ""
>   
> @@ -1073,3 +1100,42 @@ msgstr ""
>   
>   msgid "Unable to choose a virutal machine name"
>   msgstr ""
> +
> +msgid "Invalid CDROM device name"
> +msgstr ""
> +
> +msgid "Invalid storage type. Types supported: 'cdrom'"
> +msgstr ""
> +
> +#, python-format
> +msgid "The path %(value)s is not valid local/remote path for the device"
> +msgstr ""
> +
> +#, python-format
> +msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
> +msgstr ""
> +
> +msgid "Must specify a device name"
> +msgstr ""
> +
> +msgid "Can't specify a directory for a CDROM device path"
> +msgstr ""
> +
> +#, python-format
> +msgid "The storage device %(dev_name)s does not exist in the guest %(vm_name)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while creating new storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while updating storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while removing storage device: %(error)s"
> +msgstr ""
> +
> +msgid "Do not support guest CDROM hot plug attachment"
> +msgstr ""
> diff --git a/po/kimchi.pot b/po/kimchi.pot
> index a4b3935..f970d6c 100755
> --- a/po/kimchi.pot
> +++ b/po/kimchi.pot
> @@ -8,7 +8,7 @@ msgid ""
>   msgstr ""
>   "Project-Id-Version: PACKAGE VERSION\n"
>   "Report-Msgid-Bugs-To: \n"
> -"POT-Creation-Date: 2014-02-11 15:02-0200\n"
> +"POT-Creation-Date: 2014-02-14 13:34-0200\n"
>   "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
>   "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
>   "Language-Team: LANGUAGE <LL at li.org>\n"
> @@ -713,6 +713,13 @@ msgstr ""
>   msgid "Specify a template to create a virtual machine from"
>   msgstr ""
>   
> +msgid "Volume list (LUNs names) not given."
> +msgstr ""
> +
> +msgid ""
> +"Virtual machine volumes must be a list of strings with distinct LUNs names."
> +msgstr ""
> +
>   #, python-format
>   msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
>   msgstr ""
> @@ -894,6 +901,22 @@ msgid "Specify name and type to create a storage pool"
>   msgstr ""
>   
>   #, python-format
> +msgid ""
> +"%(disk)s is not a valid disk/partition. Could not add it to the pool "
> +"%(pool)s."
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while extending logical pool %(pool)s. Details: %(err)s"
> +msgstr ""
> +
> +msgid "The parameter disks only can be updated for logical storage pool."
> +msgstr ""
> +
> +msgid "The SCSI host adapter name must be a string."
> +msgstr ""
> +
> +#, python-format
>   msgid "Storage volume %(name)s already exists"
>   msgstr ""
>   
> @@ -1019,7 +1042,7 @@ msgid "Unable to create debug report %(name)s. Details: %(err)s."
>   msgstr ""
>   
>   #, python-format
> -msgid "Can not find generated debug report named %(name)s"
> +msgid "Can not find any generated debug report matching name %(name)s"
>   msgstr ""
>   
>   #, python-format
> @@ -1045,6 +1068,10 @@ msgid "Unable to reboot host machine as there are running virtual machines"
>   msgstr ""
>   
>   #, python-format
> +msgid "Node device '%(name)s' not found"
> +msgstr ""
> +
> +#, python-format
>   msgid "Unable to find %(item)s in datastore"
>   msgstr ""
>   
> @@ -1058,3 +1085,42 @@ msgstr ""
>   
>   msgid "Unable to choose a virutal machine name"
>   msgstr ""
> +
> +msgid "Invalid CDROM device name"
> +msgstr ""
> +
> +msgid "Invalid storage type. Types supported: 'cdrom'"
> +msgstr ""
> +
> +#, python-format
> +msgid "The path %(value)s is not valid local/remote path for the device"
> +msgstr ""
> +
> +#, python-format
> +msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
> +msgstr ""
> +
> +msgid "Must specify a device name"
> +msgstr ""
> +
> +msgid "Can't specify a directory for a CDROM device path"
> +msgstr ""
> +
> +#, python-format
> +msgid "The storage device %(dev_name)s does not exist in the guest %(vm_name)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while creating new storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while updating storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while removing storage device: %(error)s"
> +msgstr ""
> +
> +msgid "Do not support guest CDROM hot plug attachment"
> +msgstr ""
> diff --git a/po/pt_BR.po b/po/pt_BR.po
> index adf291a..8efa264 100644
> --- a/po/pt_BR.po
> +++ b/po/pt_BR.po
> @@ -20,7 +20,7 @@ msgid ""
>   msgstr ""
>   "Project-Id-Version: kimchi 1.0\n"
>   "Report-Msgid-Bugs-To: \n"
> -"POT-Creation-Date: 2014-02-11 15:02-0200\n"
> +"POT-Creation-Date: 2014-02-14 13:34-0200\n"
>   "PO-Revision-Date: 2013-06-27 10:48+0000\n"
>   "Last-Translator: Crístian Viana <vianac at linux.vnet.ibm.com>\n"
>   "Language-Team: Aline Manera <alinefm at br.ibm.com>\n"
> @@ -743,6 +743,13 @@ msgstr ""
>   msgid "Specify a template to create a virtual machine from"
>   msgstr ""
>   
> +msgid "Volume list (LUNs names) not given."
> +msgstr ""
> +
> +msgid ""
> +"Virtual machine volumes must be a list of strings with distinct LUNs names."
> +msgstr ""
> +
>   #, python-format
>   msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
>   msgstr ""
> @@ -924,6 +931,22 @@ msgid "Specify name and type to create a storage pool"
>   msgstr ""
>   
>   #, python-format
> +msgid ""
> +"%(disk)s is not a valid disk/partition. Could not add it to the pool "
> +"%(pool)s."
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while extending logical pool %(pool)s. Details: %(err)s"
> +msgstr ""
> +
> +msgid "The parameter disks only can be updated for logical storage pool."
> +msgstr ""
> +
> +msgid "The SCSI host adapter name must be a string."
> +msgstr ""
> +
> +#, python-format
>   msgid "Storage volume %(name)s already exists"
>   msgstr ""
>   
> @@ -1049,7 +1072,7 @@ msgid "Unable to create debug report %(name)s. Details: %(err)s."
>   msgstr ""
>   
>   #, python-format
> -msgid "Can not find generated debug report named %(name)s"
> +msgid "Can not find any generated debug report matching name %(name)s"
>   msgstr ""
>   
>   #, python-format
> @@ -1075,6 +1098,10 @@ msgid "Unable to reboot host machine as there are running virtual machines"
>   msgstr ""
>   
>   #, python-format
> +msgid "Node device '%(name)s' not found"
> +msgstr ""
> +
> +#, python-format
>   msgid "Unable to find %(item)s in datastore"
>   msgstr ""
>   
> @@ -1088,3 +1115,42 @@ msgstr ""
>   
>   msgid "Unable to choose a virutal machine name"
>   msgstr ""
> +
> +msgid "Invalid CDROM device name"
> +msgstr ""
> +
> +msgid "Invalid storage type. Types supported: 'cdrom'"
> +msgstr ""
> +
> +#, python-format
> +msgid "The path %(value)s is not valid local/remote path for the device"
> +msgstr ""
> +
> +#, python-format
> +msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
> +msgstr ""
> +
> +msgid "Must specify a device name"
> +msgstr ""
> +
> +msgid "Can't specify a directory for a CDROM device path"
> +msgstr ""
> +
> +#, python-format
> +msgid "The storage device %(dev_name)s does not exist in the guest %(vm_name)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while creating new storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while updating storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while removing storage device: %(error)s"
> +msgstr ""
> +
> +msgid "Do not support guest CDROM hot plug attachment"
> +msgstr ""
> diff --git a/po/zh_CN.po b/po/zh_CN.po
> index 88ef9ed..d0dc7fe 100644
> --- a/po/zh_CN.po
> +++ b/po/zh_CN.po
> @@ -20,7 +20,7 @@ msgid ""
>   msgstr ""
>   "Project-Id-Version: kimchi 0.1\n"
>   "Report-Msgid-Bugs-To: \n"
> -"POT-Creation-Date: 2014-02-11 15:02-0200\n"
> +"POT-Creation-Date: 2014-02-14 13:34-0200\n"
>   "PO-Revision-Date: 2013-06-27 10:48+0000\n"
>   "Last-Translator: ShaoHe Feng <shaohef at linux.vnet.ibm.com>\n"
>   "Language-Team: ShaoHe Feng <shaohef at linux.vnet.ibm.com>\n"
> @@ -731,6 +731,13 @@ msgstr ""
>   msgid "Specify a template to create a virtual machine from"
>   msgstr ""
>   
> +msgid "Volume list (LUNs names) not given."
> +msgstr ""
> +
> +msgid ""
> +"Virtual machine volumes must be a list of strings with distinct LUNs names."
> +msgstr ""
> +
>   #, python-format
>   msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
>   msgstr ""
> @@ -912,6 +919,22 @@ msgid "Specify name and type to create a storage pool"
>   msgstr ""
>   
>   #, python-format
> +msgid ""
> +"%(disk)s is not a valid disk/partition. Could not add it to the pool "
> +"%(pool)s."
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while extending logical pool %(pool)s. Details: %(err)s"
> +msgstr ""
> +
> +msgid "The parameter disks only can be updated for logical storage pool."
> +msgstr ""
> +
> +msgid "The SCSI host adapter name must be a string."
> +msgstr ""
> +
> +#, python-format
>   msgid "Storage volume %(name)s already exists"
>   msgstr ""
>   
> @@ -1037,7 +1060,7 @@ msgid "Unable to create debug report %(name)s. Details: %(err)s."
>   msgstr ""
>   
>   #, python-format
> -msgid "Can not find generated debug report named %(name)s"
> +msgid "Can not find any generated debug report matching name %(name)s"
>   msgstr ""
>   
>   #, python-format
> @@ -1063,6 +1086,10 @@ msgid "Unable to reboot host machine as there are running virtual machines"
>   msgstr ""
>   
>   #, python-format
> +msgid "Node device '%(name)s' not found"
> +msgstr ""
> +
> +#, python-format
>   msgid "Unable to find %(item)s in datastore"
>   msgstr ""
>   
> @@ -1076,3 +1103,42 @@ msgstr ""
>   
>   msgid "Unable to choose a virutal machine name"
>   msgstr ""
> +
> +msgid "Invalid CDROM device name"
> +msgstr ""
> +
> +msgid "Invalid storage type. Types supported: 'cdrom'"
> +msgstr ""
> +
> +#, python-format
> +msgid "The path %(value)s is not valid local/remote path for the device"
> +msgstr ""
> +
> +#, python-format
> +msgid "Device name %(dev_name)s already exists in vm %(vm_name)s"
> +msgstr ""
> +
> +msgid "Must specify a device name"
> +msgstr ""
> +
> +msgid "Can't specify a directory for a CDROM device path"
> +msgstr ""
> +
> +#, python-format
> +msgid "The storage device %(dev_name)s does not exist in the guest %(vm_name)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while creating new storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while updating storage device: %(error)s"
> +msgstr ""
> +
> +#, python-format
> +msgid "Error while removing storage device: %(error)s"
> +msgstr ""
> +
> +msgid "Do not support guest CDROM hot plug attachment"
> +msgstr ""
> diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
> index d3f9fcf..b21f572 100644
> --- a/src/kimchi/i18n.py
> +++ b/src/kimchi/i18n.py
> @@ -185,4 +185,16 @@ messages = {
>       "KCHUTILS0001E": _("Invalid URI %(uri)s"),
>       "KCHUTILS0002E": _("Timeout while running command '%(cmd)s' after %(seconds)s seconds"),
>       "KCHUTILS0003E": _("Unable to choose a virutal machine name"),
> +
> +    "KCHCDROM0001E": _("Invalid CDROM device name"),
> +    "KCHCDROM0002E": _("Invalid storage type. Types supported: 'cdrom'"),
> +    "KCHCDROM0003E": _("The path %(value)s is not valid local/remote path for the device"),
> +    "KCHCDROM0004E": _("Device name %(dev_name)s already exists in vm %(vm_name)s"),
> +    "KCHCDROM0005E": _("Must specify a device name"),
> +    "KCHCDROM0006E": _("Can't specify a directory for a CDROM device path"),
> +    "KCHCDROM0007E": _("The storage device %(dev_name)s does not exist in the guest %(vm_name)s"),
> +    "KCHCDROM0008E": _("Error while creating new storage device: %(error)s"),
> +    "KCHCDROM0009E": _("Error while updating storage device: %(error)s"),
> +    "KCHCDROM0010E": _("Error while removing storage device: %(error)s"),
> +    "KCHCDROM0011E": _("Do not support guest CDROM hot plug attachment"),
>   }




More information about the Kimchi-devel mailing list