[PATCH 0/2 v4] guest-storage-add: removing 'Storage Name'

These patches removes the option to set the device name of the attached storage from the UI and backend. Daniel Henrique Barboza (2): guest-storage-add: removing "Storage Name" field guest-storage-add: removing "Storage Name" backend support docs/API.md | 1 - po/de_DE.po | 10 --------- po/en_US.po | 8 -------- po/es_ES.po | 10 --------- po/fr_FR.po | 10 --------- po/it_IT.po | 10 --------- po/ja_JP.po | 10 --------- po/kimchi.pot | 8 -------- po/ko_KR.po | 9 -------- po/pt_BR.po | 10 --------- po/ru_RU.po | 10 --------- po/zh_CN.po | 8 -------- po/zh_TW.po | 8 -------- src/kimchi/API.json | 6 ------ src/kimchi/i18n.py | 2 -- src/kimchi/mockmodel.py | 9 ++------ src/kimchi/model/vmstorages.py | 33 ++++++++++++------------------ tests/test_model.py | 5 ----- tests/test_rest.py | 14 ++++++------- ui/js/src/kimchi.guest_storage_add.main.js | 7 +++---- ui/pages/guest-storage-add.html.tmpl | 17 ++++----------- 21 files changed, 28 insertions(+), 177 deletions(-) -- 1.8.3.1

This specific field adds very little to the user experience in comparison with the effort required to mantain it. This patch removes it from the UI, making the "Add a Storage Device to VM" window simpler. Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- po/de_DE.po | 10 ---------- po/en_US.po | 8 -------- po/es_ES.po | 10 ---------- po/fr_FR.po | 10 ---------- po/it_IT.po | 10 ---------- po/ja_JP.po | 10 ---------- po/kimchi.pot | 8 -------- po/ko_KR.po | 9 --------- po/pt_BR.po | 10 ---------- po/ru_RU.po | 10 ---------- po/zh_CN.po | 8 -------- po/zh_TW.po | 8 -------- src/kimchi/i18n.py | 2 -- ui/js/src/kimchi.guest_storage_add.main.js | 7 +++---- ui/pages/guest-storage-add.html.tmpl | 17 ++++------------- 15 files changed, 7 insertions(+), 130 deletions(-) diff --git a/po/de_DE.po b/po/de_DE.po index 06d8c38..3c8a3a9 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -1183,16 +1183,6 @@ msgstr "Löschen" msgid "Add a Storage Device to VM" msgstr "Speichereinheit zur virtuellen Maschine hinzufügen" -msgid "Device Name" -msgstr "Einheitenname" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Der Name, mit dem die Einheit gekennzeichnet wird. Falls er ausgelassen " -"wird, wird automatisch ein Name gewählt." - msgid "Device Type" msgstr "Einheitentyp" diff --git a/po/en_US.po b/po/en_US.po index 11fcec9..bc851b2 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -1057,14 +1057,6 @@ msgstr "" msgid "Add a Storage Device to VM" msgstr "" -msgid "Device Name" -msgstr "" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" - msgid "Device Type" msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po index 4aec448..d966fd6 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -1201,16 +1201,6 @@ msgstr "Suprimir" msgid "Add a Storage Device to VM" msgstr "Añadir un dispositivo de almacenamiento a VM" -msgid "Device Name" -msgstr "Nombre de dispositivo" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"El nombre que se utiliza para identificar el dispositivo. Si se omite, se " -"elegirá un nombre automáticamente" - msgid "Device Type" msgstr "Tipo de dispositivo" diff --git a/po/fr_FR.po b/po/fr_FR.po index 6b2bd2d..c4746d0 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -1189,16 +1189,6 @@ msgstr "Supprimer" msgid "Add a Storage Device to VM" msgstr "Ajouter un Périphérique de Stockage à la VM" -msgid "Device Name" -msgstr "Nom de Périphérique" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Le nom utilisé pour identifier le périphérique. Si omis, un nom sera choisi " -"automatiquement." - msgid "Device Type" msgstr "Type de Périphérique" diff --git a/po/it_IT.po b/po/it_IT.po index 3293fa2..cb6ea0f 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -1170,16 +1170,6 @@ msgstr "Elimina" msgid "Add a Storage Device to VM" msgstr "Aggiungi un dispositivo di memoria alla VM" -msgid "Device Name" -msgstr "Nome dispositivo" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Il nome utilizzato per identificare il dispositivo. Se omesso, ne verrà " -"scelto uno automaticamente." - msgid "Device Type" msgstr "Tipo dispositivo" diff --git a/po/ja_JP.po b/po/ja_JP.po index a2740bf..fd419ce 100644 --- a/po/ja_JP.po +++ b/po/ja_JP.po @@ -1182,16 +1182,6 @@ msgstr "削除" msgid "Add a Storage Device to VM" msgstr "VM にストレージ・デバイスを追加" -msgid "Device Name" -msgstr "デバイス名" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"名前はデバイスを識別するために使用されます。省略すると、名前は自動的に選択さ" -"れます。" - msgid "Device Type" msgstr "デバイス・タイプ" diff --git a/po/kimchi.pot b/po/kimchi.pot index cd0a1ac..53d32ef 100755 --- a/po/kimchi.pot +++ b/po/kimchi.pot @@ -1057,14 +1057,6 @@ msgstr "" msgid "Add a Storage Device to VM" msgstr "" -msgid "Device Name" -msgstr "" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" - msgid "Device Type" msgstr "" diff --git a/po/ko_KR.po b/po/ko_KR.po index 20e8a0f..0a7e8ac 100644 --- a/po/ko_KR.po +++ b/po/ko_KR.po @@ -1113,15 +1113,6 @@ msgstr "삭제" msgid "Add a Storage Device to VM" msgstr "스토리지 장치를 VM에 추가" -msgid "Device Name" -msgstr "장치 이름" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"장치를 식별하는 데 사용되는 이름입니다. 생략 시 이름이 자동으로 선택됩니다." - msgid "Device Type" msgstr "장치 유형" diff --git a/po/pt_BR.po b/po/pt_BR.po index 7d18a2d..d94cd11 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1189,16 +1189,6 @@ msgstr "Remover" msgid "Add a Storage Device to VM" msgstr "Adicionar um dispositivo de storage à VM" -msgid "Device Name" -msgstr "Nome do dispositivo" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"O nome usado para identificar o dispositivo. Se omitido, um nome será " -"escolhido automaticamente." - msgid "Device Type" msgstr "Tipo do Dispositivo" diff --git a/po/ru_RU.po b/po/ru_RU.po index 069e083..6e542b4 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -1113,16 +1113,6 @@ msgstr "Удалить" msgid "Add a Storage Device to VM" msgstr "Добавить устройство хранения в VM" -msgid "Device Name" -msgstr "Имя устройства" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Имя для идентификации устройства. Если не указано, то имя будет выбрано " -"автоматически." - msgid "Device Type" msgstr "Тип устройства" diff --git a/po/zh_CN.po b/po/zh_CN.po index e6f9ac7..29a615b 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1076,14 +1076,6 @@ msgstr "删除" msgid "Add a Storage Device to VM" msgstr "为虚拟机添加一个存储设备" -msgid "Device Name" -msgstr "设备名称" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "设备名称,如果留空系统会自动生成一个" - msgid "Device Type" msgstr "设备类型" diff --git a/po/zh_TW.po b/po/zh_TW.po index 69e1c9a..e084aa7 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1060,14 +1060,6 @@ msgstr "刪除" msgid "Add a Storage Device to VM" msgstr "將儲存裝置新增至 VM" -msgid "Device Name" -msgstr "裝置名稱" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "用來識別裝置的名稱。如果省略,則將自動選擇一個名稱。" - msgid "Device Type" msgstr "裝置類型" diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py index 9e66c68..552be25 100644 --- a/src/kimchi/i18n.py +++ b/src/kimchi/i18n.py @@ -243,10 +243,8 @@ messages = { "KCHUTILS0002E": _("Timeout while running command '%(cmd)s' after %(seconds)s seconds"), "KCHUTILS0003E": _("Unable to choose a virtual machine name"), - "KCHVMSTOR0001E": _("Invalid vm storage device name"), "KCHVMSTOR0002E": _("Invalid storage type. Types supported: 'cdrom', 'disk'"), "KCHVMSTOR0003E": _("The path '%(value)s' is not a valid local/remote path for the device"), - "KCHVMSTOR0004E": _("Device name %(dev_name)s already exists in the virtual machine %(vm_name)s"), "KCHVMSTOR0006E": _("Only CDROM path can be update."), "KCHVMSTOR0007E": _("The storage device %(dev_name)s does not exist in the virtual machine %(vm_name)s"), "KCHVMSTOR0008E": _("Error while creating new storage device: %(error)s"), diff --git a/ui/js/src/kimchi.guest_storage_add.main.js b/ui/js/src/kimchi.guest_storage_add.main.js index a8c5acb..54ae748 100644 --- a/ui/js/src/kimchi.guest_storage_add.main.js +++ b/ui/js/src/kimchi.guest_storage_add.main.js @@ -28,7 +28,6 @@ kimchi.guest_storage_add_main = function() { var storageAddForm = $('#form-guest-storage-add'); var submitButton = $('#guest-storage-button-add'); - var nameTextbox = $('input[name="dev"]', storageAddForm); var typeTextbox = $('input[name="type"]', storageAddForm); var pathTextbox = $('input[name="path"]', storageAddForm); var poolTextbox = $('input[name="pool"]', storageAddForm); @@ -139,7 +138,7 @@ kimchi.guest_storage_add_main = function() { }; $(submitButton).prop('disabled', true); - $.each([nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) { + $.each([pathTextbox, poolTextbox, volTextbox], function(i, c) { $(c).prop('disabled', true); val = $(c).val() if (val && val != '') { @@ -150,7 +149,7 @@ kimchi.guest_storage_add_main = function() { validateSpecifiedForm = validator[settings['type']]; if (!validateSpecifiedForm(settings)) { $(submitButton).prop('disabled', false); - $.each([submitButton, nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) { + $.each([submitButton, pathTextbox, poolTextbox, volTextbox], function(i, c) { $(c).prop('disabled', false); }); return false; @@ -167,7 +166,7 @@ kimchi.guest_storage_add_main = function() { result['responseJSON']['reason']; kimchi.message.error(errText); - $.each([submitButton, nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) { + $.each([submitButton, pathTextbox, poolTextbox, volTextbox], function(i, c) { $(c).prop('disabled', false); }); $(submitButton).removeClass('loading').text(i18n['KCHVMCD6002M']); diff --git a/ui/pages/guest-storage-add.html.tmpl b/ui/pages/guest-storage-add.html.tmpl index ca064fc..c991f42 100644 --- a/ui/pages/guest-storage-add.html.tmpl +++ b/ui/pages/guest-storage-add.html.tmpl @@ -29,16 +29,7 @@ <div class="content"> <form id="form-guest-storage-add"> <section class="form-section"> - <h2>1. $_("Device Name")</h2> - <div class="field"> - <p class="text-help"> - $_("The name used to identify the device. If omitted, a name will be chosen automatically.") - </p> - <input type="text" class="text" name="dev" /> - </div> - </section> - <section class="form-section"> - <h2>2. $_("Device Type")</h2> + <h2>1. $_("Device Type")</h2> <div class="field"> <p class="text-help"> $_("The device type. Currently, \"cdrom\" and \"disk\" are supported.") @@ -55,7 +46,7 @@ </section> <div class="volume-section hidden"> <section class="form-section"> - <h2>4. $_("Storage Pool")</h2> + <h2>2. $_("Storage Pool")</h2> <div class="field storage-field"> <p class="text-help"> $_("Storage pool which volume located in") @@ -70,7 +61,7 @@ </div> </section> <section class="form-section"> - <h2>5. $_("Storage Volume")</h2> + <h2>3. $_("Storage Volume")</h2> <div class="field storage-field"> <p class="text-help"> $_("Storage volume to be attached") @@ -87,7 +78,7 @@ </div> <div class="path-section"> <section class="form-section"> - <h2>4. $_("File Path")</h2> + <h2>2. $_("File Path")</h2> <div class="field"> <p class="text-help"> $_("The ISO file path in the server for CDROM.") -- 1.8.3.1

Reviewed-by: Royce Lv<lvroyce@linux.vnet.ibm.com> On 2014年09月20日 05:49, Daniel Henrique Barboza wrote:
This specific field adds very little to the user experience in comparison with the effort required to mantain it. This patch removes it from the UI, making the "Add a Storage Device to VM" window simpler.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- po/de_DE.po | 10 ---------- po/en_US.po | 8 -------- po/es_ES.po | 10 ---------- po/fr_FR.po | 10 ---------- po/it_IT.po | 10 ---------- po/ja_JP.po | 10 ---------- po/kimchi.pot | 8 -------- po/ko_KR.po | 9 --------- po/pt_BR.po | 10 ---------- po/ru_RU.po | 10 ---------- po/zh_CN.po | 8 -------- po/zh_TW.po | 8 -------- src/kimchi/i18n.py | 2 -- ui/js/src/kimchi.guest_storage_add.main.js | 7 +++---- ui/pages/guest-storage-add.html.tmpl | 17 ++++------------- 15 files changed, 7 insertions(+), 130 deletions(-)
diff --git a/po/de_DE.po b/po/de_DE.po index 06d8c38..3c8a3a9 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -1183,16 +1183,6 @@ msgstr "Löschen" msgid "Add a Storage Device to VM" msgstr "Speichereinheit zur virtuellen Maschine hinzufügen"
-msgid "Device Name" -msgstr "Einheitenname" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Der Name, mit dem die Einheit gekennzeichnet wird. Falls er ausgelassen " -"wird, wird automatisch ein Name gewählt." - msgid "Device Type" msgstr "Einheitentyp"
diff --git a/po/en_US.po b/po/en_US.po index 11fcec9..bc851b2 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -1057,14 +1057,6 @@ msgstr "" msgid "Add a Storage Device to VM" msgstr ""
-msgid "Device Name" -msgstr "" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" - msgid "Device Type" msgstr ""
diff --git a/po/es_ES.po b/po/es_ES.po index 4aec448..d966fd6 100644 --- a/po/es_ES.po +++ b/po/es_ES.po @@ -1201,16 +1201,6 @@ msgstr "Suprimir" msgid "Add a Storage Device to VM" msgstr "Añadir un dispositivo de almacenamiento a VM"
-msgid "Device Name" -msgstr "Nombre de dispositivo" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"El nombre que se utiliza para identificar el dispositivo. Si se omite, se " -"elegirá un nombre automáticamente" - msgid "Device Type" msgstr "Tipo de dispositivo"
diff --git a/po/fr_FR.po b/po/fr_FR.po index 6b2bd2d..c4746d0 100644 --- a/po/fr_FR.po +++ b/po/fr_FR.po @@ -1189,16 +1189,6 @@ msgstr "Supprimer" msgid "Add a Storage Device to VM" msgstr "Ajouter un Périphérique de Stockage à la VM"
-msgid "Device Name" -msgstr "Nom de Périphérique" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Le nom utilisé pour identifier le périphérique. Si omis, un nom sera choisi " -"automatiquement." - msgid "Device Type" msgstr "Type de Périphérique"
diff --git a/po/it_IT.po b/po/it_IT.po index 3293fa2..cb6ea0f 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -1170,16 +1170,6 @@ msgstr "Elimina" msgid "Add a Storage Device to VM" msgstr "Aggiungi un dispositivo di memoria alla VM"
-msgid "Device Name" -msgstr "Nome dispositivo" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Il nome utilizzato per identificare il dispositivo. Se omesso, ne verrà " -"scelto uno automaticamente." - msgid "Device Type" msgstr "Tipo dispositivo"
diff --git a/po/ja_JP.po b/po/ja_JP.po index a2740bf..fd419ce 100644 --- a/po/ja_JP.po +++ b/po/ja_JP.po @@ -1182,16 +1182,6 @@ msgstr "削除" msgid "Add a Storage Device to VM" msgstr "VM にストレージ・デバイスを追加"
-msgid "Device Name" -msgstr "デバイス名" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"名前はデバイスを識別するために使用されます。省略すると、名前は自動的に選択さ" -"れます。" - msgid "Device Type" msgstr "デバイス・タイプ"
diff --git a/po/kimchi.pot b/po/kimchi.pot index cd0a1ac..53d32ef 100755 --- a/po/kimchi.pot +++ b/po/kimchi.pot @@ -1057,14 +1057,6 @@ msgstr "" msgid "Add a Storage Device to VM" msgstr ""
-msgid "Device Name" -msgstr "" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" - msgid "Device Type" msgstr ""
diff --git a/po/ko_KR.po b/po/ko_KR.po index 20e8a0f..0a7e8ac 100644 --- a/po/ko_KR.po +++ b/po/ko_KR.po @@ -1113,15 +1113,6 @@ msgstr "삭제" msgid "Add a Storage Device to VM" msgstr "스토리지 장치를 VM에 추가"
-msgid "Device Name" -msgstr "장치 이름" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"장치를 식별하는 데 사용되는 이름입니다. 생략 시 이름이 자동으로 선택됩니다." - msgid "Device Type" msgstr "장치 유형"
diff --git a/po/pt_BR.po b/po/pt_BR.po index 7d18a2d..d94cd11 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -1189,16 +1189,6 @@ msgstr "Remover" msgid "Add a Storage Device to VM" msgstr "Adicionar um dispositivo de storage à VM"
-msgid "Device Name" -msgstr "Nome do dispositivo" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"O nome usado para identificar o dispositivo. Se omitido, um nome será " -"escolhido automaticamente." - msgid "Device Type" msgstr "Tipo do Dispositivo"
diff --git a/po/ru_RU.po b/po/ru_RU.po index 069e083..6e542b4 100644 --- a/po/ru_RU.po +++ b/po/ru_RU.po @@ -1113,16 +1113,6 @@ msgstr "Удалить" msgid "Add a Storage Device to VM" msgstr "Добавить устройство хранения в VM"
-msgid "Device Name" -msgstr "Имя устройства" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "" -"Имя для идентификации устройства. Если не указано, то имя будет выбрано " -"автоматически." - msgid "Device Type" msgstr "Тип устройства"
diff --git a/po/zh_CN.po b/po/zh_CN.po index e6f9ac7..29a615b 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -1076,14 +1076,6 @@ msgstr "删除" msgid "Add a Storage Device to VM" msgstr "为虚拟机添加一个存储设备"
-msgid "Device Name" -msgstr "设备名称" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "设备名称,如果留空系统会自动生成一个" - msgid "Device Type" msgstr "设备类型"
diff --git a/po/zh_TW.po b/po/zh_TW.po index 69e1c9a..e084aa7 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -1060,14 +1060,6 @@ msgstr "刪除" msgid "Add a Storage Device to VM" msgstr "將儲存裝置新增至 VM"
-msgid "Device Name" -msgstr "裝置名稱" - -msgid "" -"The name used to identify the device. If omitted, a name will be chosen " -"automatically." -msgstr "用來識別裝置的名稱。如果省略,則將自動選擇一個名稱。" - msgid "Device Type" msgstr "裝置類型"
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py index 9e66c68..552be25 100644 --- a/src/kimchi/i18n.py +++ b/src/kimchi/i18n.py @@ -243,10 +243,8 @@ messages = { "KCHUTILS0002E": _("Timeout while running command '%(cmd)s' after %(seconds)s seconds"), "KCHUTILS0003E": _("Unable to choose a virtual machine name"),
- "KCHVMSTOR0001E": _("Invalid vm storage device name"), "KCHVMSTOR0002E": _("Invalid storage type. Types supported: 'cdrom', 'disk'"), "KCHVMSTOR0003E": _("The path '%(value)s' is not a valid local/remote path for the device"), - "KCHVMSTOR0004E": _("Device name %(dev_name)s already exists in the virtual machine %(vm_name)s"), "KCHVMSTOR0006E": _("Only CDROM path can be update."), "KCHVMSTOR0007E": _("The storage device %(dev_name)s does not exist in the virtual machine %(vm_name)s"), "KCHVMSTOR0008E": _("Error while creating new storage device: %(error)s"), diff --git a/ui/js/src/kimchi.guest_storage_add.main.js b/ui/js/src/kimchi.guest_storage_add.main.js index a8c5acb..54ae748 100644 --- a/ui/js/src/kimchi.guest_storage_add.main.js +++ b/ui/js/src/kimchi.guest_storage_add.main.js @@ -28,7 +28,6 @@ kimchi.guest_storage_add_main = function() {
var storageAddForm = $('#form-guest-storage-add'); var submitButton = $('#guest-storage-button-add'); - var nameTextbox = $('input[name="dev"]', storageAddForm); var typeTextbox = $('input[name="type"]', storageAddForm); var pathTextbox = $('input[name="path"]', storageAddForm); var poolTextbox = $('input[name="pool"]', storageAddForm); @@ -139,7 +138,7 @@ kimchi.guest_storage_add_main = function() { };
$(submitButton).prop('disabled', true); - $.each([nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) { + $.each([pathTextbox, poolTextbox, volTextbox], function(i, c) { $(c).prop('disabled', true); val = $(c).val() if (val && val != '') { @@ -150,7 +149,7 @@ kimchi.guest_storage_add_main = function() { validateSpecifiedForm = validator[settings['type']]; if (!validateSpecifiedForm(settings)) { $(submitButton).prop('disabled', false); - $.each([submitButton, nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) { + $.each([submitButton, pathTextbox, poolTextbox, volTextbox], function(i, c) { $(c).prop('disabled', false); }); return false; @@ -167,7 +166,7 @@ kimchi.guest_storage_add_main = function() { result['responseJSON']['reason']; kimchi.message.error(errText);
- $.each([submitButton, nameTextbox, pathTextbox, poolTextbox, volTextbox], function(i, c) { + $.each([submitButton, pathTextbox, poolTextbox, volTextbox], function(i, c) { $(c).prop('disabled', false); }); $(submitButton).removeClass('loading').text(i18n['KCHVMCD6002M']); diff --git a/ui/pages/guest-storage-add.html.tmpl b/ui/pages/guest-storage-add.html.tmpl index ca064fc..c991f42 100644 --- a/ui/pages/guest-storage-add.html.tmpl +++ b/ui/pages/guest-storage-add.html.tmpl @@ -29,16 +29,7 @@ <div class="content"> <form id="form-guest-storage-add"> <section class="form-section"> - <h2>1. $_("Device Name")</h2> - <div class="field"> - <p class="text-help"> - $_("The name used to identify the device. If omitted, a name will be chosen automatically.") - </p> - <input type="text" class="text" name="dev" /> - </div> - </section> - <section class="form-section"> - <h2>2. $_("Device Type")</h2> + <h2>1. $_("Device Type")</h2> <div class="field"> <p class="text-help"> $_("The device type. Currently, \"cdrom\" and \"disk\" are supported.") @@ -55,7 +46,7 @@ </section> <div class="volume-section hidden"> <section class="form-section"> - <h2>4. $_("Storage Pool")</h2> + <h2>2. $_("Storage Pool")</h2> <div class="field storage-field"> <p class="text-help"> $_("Storage pool which volume located in") @@ -70,7 +61,7 @@ </div> </section> <section class="form-section"> - <h2>5. $_("Storage Volume")</h2> + <h2>3. $_("Storage Volume")</h2> <div class="field storage-field"> <p class="text-help"> $_("Storage volume to be attached") @@ -87,7 +78,7 @@ </div> <div class="path-section"> <section class="form-section"> - <h2>4. $_("File Path")</h2> + <h2>2. $_("File Path")</h2> <div class="field"> <p class="text-help"> $_("The ISO file path in the server for CDROM.")

This patch fixes APIs, models and tests to reflect the removal of the "Storage Name" field that was done in the UI.
From now on, all device names will be generated automatically.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- docs/API.md | 1 - src/kimchi/API.json | 6 ------ src/kimchi/mockmodel.py | 9 ++------- src/kimchi/model/vmstorages.py | 33 +++++++++++++-------------------- tests/test_model.py | 5 ----- tests/test_rest.py | 14 ++++++-------- 6 files changed, 21 insertions(+), 47 deletions(-) diff --git a/docs/API.md b/docs/API.md index b679ce7..cc438cc 100644 --- a/docs/API.md +++ b/docs/API.md @@ -148,7 +148,6 @@ Represents a snapshot of the Virtual Machine's primary monitor. **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 support 'cdrom' and 'disk'). * path: Path of cdrom iso. * pool: Storage pool which disk image file locate in. diff --git a/src/kimchi/API.json b/src/kimchi/API.json index b8604d2..f262e1c 100644 --- a/src/kimchi/API.json +++ b/src/kimchi/API.json @@ -486,12 +486,6 @@ "type": "object", "error": "KCHVMSTOR0012E", "properties": { - "dev": { - "description": "The storage device name", - "type": "string", - "pattern": "^h|vd[b-z]$", - "error": "KCHVMSTOR0001E" - }, "type": { "description": "The storage type", "type": "string", diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py index 8b58c36..aa8441e 100644 --- a/src/kimchi/mockmodel.py +++ b/src/kimchi/mockmodel.py @@ -801,13 +801,8 @@ class MockModel(object): except Exception as e: raise InvalidParameter("KCHVMSTOR0015E", {'error': e}) dom = self._get_vm(vm_name) - dev = params.get('dev', None) - if dev and dev in self.vmstorages_get_list(vm_name): - return OperationFailed( - "KCHVMSTOR0004E", {'dev_name': dev, 'vm_name': vm_name}) - if not dev: - index = len(dom.storagedevices.keys()) + 1 - params['dev'] = "hd" + string.ascii_lowercase[index] + index = len(dom.storagedevices.keys()) + 1 + params['dev'] = "hd" + string.ascii_lowercase[index] vmdev = MockVMStorageDevice(params) dom.storagedevices[params['dev']] = vmdev diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index 54e2685..4d6c0b2 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -174,26 +174,19 @@ class VMStoragesModel(object): return params['dev'] def _get_storage_device_name(self, vm_name, params): - if params.get('dev') is None: - bus_prefix = PREFIX_MAP[params['bus']] - dev_list = [dev for dev in self.get_list(vm_name) - if dev.startswith(bus_prefix)] - if len(dev_list) == 0: - params['dev'] = bus_prefix + 'a' - else: - dev_list.sort() - last_dev = dev_list.pop() - # TODO: Improve to device names "greater then" hdz - next_dev_letter_pos =\ - string.ascii_lowercase.index(last_dev[2]) + 1 - params['dev'] =\ - bus_prefix + string.ascii_lowercase[next_dev_letter_pos] - - devices = self.get_list(vm_name) - if params['dev'] in devices: - raise OperationFailed( - 'KCHVMSTOR0004E', - {'dev_name': params['dev'], 'vm_name': vm_name}) + bus_prefix = PREFIX_MAP[params['bus']] + dev_list = [dev for dev in self.get_list(vm_name) + if dev.startswith(bus_prefix)] + if len(dev_list) == 0: + params['dev'] = bus_prefix + 'a' + else: + dev_list.sort() + last_dev = dev_list.pop() + # TODO: Improve to device names "greater then" hdz + next_dev_letter_pos =\ + string.ascii_lowercase.index(last_dev[2]) + 1 + params['dev'] =\ + bus_prefix + string.ascii_lowercase[next_dev_letter_pos] def get_list(self, vm_name): dom = VMModel.get_vm(vm_name, self.conn) diff --git a/tests/test_model.py b/tests/test_model.py index ceedc6f..d458478 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -356,11 +356,6 @@ class ModelTests(unittest.TestCase): self.assertEquals(u'cdrom', cd_info['type']) self.assertEquals(iso_path, cd_info['path']) - # create a cdrom with existing dev_name - cdrom_args['dev'] = cdrom_dev - self.assertRaises(OperationFailed, inst.vmstorages_create, - vm_name, cdrom_args) - # update path of existing cd with # non existent iso self.assertRaises(InvalidParameter, inst.vmstorage_update, diff --git a/tests/test_rest.py b/tests/test_rest.py index 7778019..7eb6233 100644 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -535,26 +535,23 @@ class RestTests(unittest.TestCase): self.assertEquals(400, resp.status) # Attach disk with pool and vol specified - req = json.dumps({'dev': 'hdx', - 'type': 'disk', + req = json.dumps({'type': 'disk', 'pool': 'tmp', 'vol': 'attach-volume'}) resp = self.request('/vms/test-vm/storages', req, 'POST') self.assertEquals(201, resp.status) cd_info = json.loads(resp.read()) - self.assertEquals('hdx', cd_info['dev']) self.assertEquals('disk', cd_info['type']) self.assertEquals('tmp', cd_info['pool']) self.assertEquals('attach-volume', cd_info['vol']) # Attach a cdrom with existent dev name - req = json.dumps({'dev': 'hdk', - 'type': 'cdrom', + req = json.dumps({'type': 'cdrom', 'path': '/tmp/existent.iso'}) resp = self.request('/vms/test-vm/storages', req, 'POST') self.assertEquals(201, resp.status) cd_info = json.loads(resp.read()) - self.assertEquals('hdk', cd_info['dev']) + cd_dev = cd_info['dev'] self.assertEquals('cdrom', cd_info['type']) self.assertEquals('/tmp/existent.iso', cd_info['path']) # Delete the file and cdrom @@ -564,7 +561,7 @@ class RestTests(unittest.TestCase): # Change path of storage cdrom req = json.dumps({'path': 'http://myserver.com/myiso.iso'}) - resp = self.request('/vms/test-vm/storages/hdx', req, 'PUT') + resp = self.request('/vms/test-vm/storages/'+cd_dev, req, 'PUT') self.assertEquals(200, resp.status) cd_info = json.loads(resp.read()) self.assertEquals('http://myserver.com/myiso.iso', cd_info['path']) @@ -574,7 +571,8 @@ class RestTests(unittest.TestCase): self.assertEquals(4, len(devs)) # Detach storage cdrom - resp = self.request('/vms/test-vm/storages/hdx', '{}', 'DELETE') + resp = self.request('/vms/test-vm/storages/'+cd_dev, + '{}', 'DELETE') self.assertEquals(204, resp.status) # Test GET -- 1.8.3.1

Just nit below... On 2014年09月20日 05:49, Daniel Henrique Barboza wrote:
This patch fixes APIs, models and tests to reflect the removal of the "Storage Name" field that was done in the UI.
From now on, all device names will be generated automatically.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- docs/API.md | 1 - src/kimchi/API.json | 6 ------ src/kimchi/mockmodel.py | 9 ++------- src/kimchi/model/vmstorages.py | 33 +++++++++++++-------------------- tests/test_model.py | 5 ----- tests/test_rest.py | 14 ++++++-------- 6 files changed, 21 insertions(+), 47 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b679ce7..cc438cc 100644 --- a/docs/API.md +++ b/docs/API.md @@ -148,7 +148,6 @@ Represents a snapshot of the Virtual Machine's primary monitor. **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 support 'cdrom' and 'disk'). * path: Path of cdrom iso. * pool: Storage pool which disk image file locate in. diff --git a/src/kimchi/API.json b/src/kimchi/API.json index b8604d2..f262e1c 100644 --- a/src/kimchi/API.json +++ b/src/kimchi/API.json @@ -486,12 +486,6 @@ "type": "object", "error": "KCHVMSTOR0012E", "properties": { - "dev": { - "description": "The storage device name", - "type": "string", - "pattern": "^h|vd[b-z]$", - "error": "KCHVMSTOR0001E" - }, "type": { "description": "The storage type", "type": "string", diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py index 8b58c36..aa8441e 100644 --- a/src/kimchi/mockmodel.py +++ b/src/kimchi/mockmodel.py @@ -801,13 +801,8 @@ class MockModel(object): except Exception as e: raise InvalidParameter("KCHVMSTOR0015E", {'error': e}) dom = self._get_vm(vm_name) - dev = params.get('dev', None) - if dev and dev in self.vmstorages_get_list(vm_name): - return OperationFailed( - "KCHVMSTOR0004E", {'dev_name': dev, 'vm_name': vm_name}) - if not dev: - index = len(dom.storagedevices.keys()) + 1 - params['dev'] = "hd" + string.ascii_lowercase[index] + index = len(dom.storagedevices.keys()) + 1 + params['dev'] = "hd" + string.ascii_lowercase[index]
vmdev = MockVMStorageDevice(params) dom.storagedevices[params['dev']] = vmdev diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index 54e2685..4d6c0b2 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -174,26 +174,19 @@ class VMStoragesModel(object): return params['dev']
def _get_storage_device_name(self, vm_name, params): - if params.get('dev') is None: - bus_prefix = PREFIX_MAP[params['bus']] - dev_list = [dev for dev in self.get_list(vm_name) - if dev.startswith(bus_prefix)] - if len(dev_list) == 0: - params['dev'] = bus_prefix + 'a' - else: - dev_list.sort() - last_dev = dev_list.pop() - # TODO: Improve to device names "greater then" hdz - next_dev_letter_pos =\ - string.ascii_lowercase.index(last_dev[2]) + 1 - params['dev'] =\ - bus_prefix + string.ascii_lowercase[next_dev_letter_pos] - - devices = self.get_list(vm_name) - if params['dev'] in devices: - raise OperationFailed( - 'KCHVMSTOR0004E', Seems i18n.py needs to be updated to get 'KCHVMSTOR0004E' deleted. - {'dev_name': params['dev'], 'vm_name': vm_name}) + bus_prefix = PREFIX_MAP[params['bus']] + dev_list = [dev for dev in self.get_list(vm_name) + if dev.startswith(bus_prefix)] + if len(dev_list) == 0: + params['dev'] = bus_prefix + 'a' + else: + dev_list.sort() + last_dev = dev_list.pop() + # TODO: Improve to device names "greater then" hdz + next_dev_letter_pos =\ + string.ascii_lowercase.index(last_dev[2]) + 1 + params['dev'] =\ + bus_prefix + string.ascii_lowercase[next_dev_letter_pos]
def get_list(self, vm_name): dom = VMModel.get_vm(vm_name, self.conn) diff --git a/tests/test_model.py b/tests/test_model.py index ceedc6f..d458478 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -356,11 +356,6 @@ class ModelTests(unittest.TestCase): self.assertEquals(u'cdrom', cd_info['type']) self.assertEquals(iso_path, cd_info['path'])
- # create a cdrom with existing dev_name - cdrom_args['dev'] = cdrom_dev - self.assertRaises(OperationFailed, inst.vmstorages_create, - vm_name, cdrom_args) - # update path of existing cd with # non existent iso self.assertRaises(InvalidParameter, inst.vmstorage_update, diff --git a/tests/test_rest.py b/tests/test_rest.py index 7778019..7eb6233 100644 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -535,26 +535,23 @@ class RestTests(unittest.TestCase): self.assertEquals(400, resp.status)
# Attach disk with pool and vol specified - req = json.dumps({'dev': 'hdx', - 'type': 'disk', + req = json.dumps({'type': 'disk', 'pool': 'tmp', 'vol': 'attach-volume'}) resp = self.request('/vms/test-vm/storages', req, 'POST') self.assertEquals(201, resp.status) cd_info = json.loads(resp.read()) - self.assertEquals('hdx', cd_info['dev']) self.assertEquals('disk', cd_info['type']) self.assertEquals('tmp', cd_info['pool']) self.assertEquals('attach-volume', cd_info['vol'])
# Attach a cdrom with existent dev name - req = json.dumps({'dev': 'hdk', - 'type': 'cdrom', + req = json.dumps({'type': 'cdrom', 'path': '/tmp/existent.iso'}) resp = self.request('/vms/test-vm/storages', req, 'POST') self.assertEquals(201, resp.status) cd_info = json.loads(resp.read()) - self.assertEquals('hdk', cd_info['dev']) + cd_dev = cd_info['dev'] self.assertEquals('cdrom', cd_info['type']) self.assertEquals('/tmp/existent.iso', cd_info['path']) # Delete the file and cdrom @@ -564,7 +561,7 @@ class RestTests(unittest.TestCase):
# Change path of storage cdrom req = json.dumps({'path': 'http://myserver.com/myiso.iso'}) - resp = self.request('/vms/test-vm/storages/hdx', req, 'PUT') + resp = self.request('/vms/test-vm/storages/'+cd_dev, req, 'PUT') self.assertEquals(200, resp.status) cd_info = json.loads(resp.read()) self.assertEquals('http://myserver.com/myiso.iso', cd_info['path']) @@ -574,7 +571,8 @@ class RestTests(unittest.TestCase): self.assertEquals(4, len(devs))
# Detach storage cdrom - resp = self.request('/vms/test-vm/storages/hdx', '{}', 'DELETE') + resp = self.request('/vms/test-vm/storages/'+cd_dev, + '{}', 'DELETE') self.assertEquals(204, resp.status)
# Test GET

Reviewed-by: Royce Lv<lvroyce@linux.vnet.ibm.com> Pls ignore my previous comments, as I am used to started from backend... On 2014年09月22日 17:36, Royce Lv wrote:
Just nit below... On 2014年09月20日 05:49, Daniel Henrique Barboza wrote:
This patch fixes APIs, models and tests to reflect the removal of the "Storage Name" field that was done in the UI.
From now on, all device names will be generated automatically.
Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com> --- docs/API.md | 1 - src/kimchi/API.json | 6 ------ src/kimchi/mockmodel.py | 9 ++------- src/kimchi/model/vmstorages.py | 33 +++++++++++++-------------------- tests/test_model.py | 5 ----- tests/test_rest.py | 14 ++++++-------- 6 files changed, 21 insertions(+), 47 deletions(-)
diff --git a/docs/API.md b/docs/API.md index b679ce7..cc438cc 100644 --- a/docs/API.md +++ b/docs/API.md @@ -148,7 +148,6 @@ Represents a snapshot of the Virtual Machine's primary monitor. **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 support 'cdrom' and 'disk'). * path: Path of cdrom iso. * pool: Storage pool which disk image file locate in. diff --git a/src/kimchi/API.json b/src/kimchi/API.json index b8604d2..f262e1c 100644 --- a/src/kimchi/API.json +++ b/src/kimchi/API.json @@ -486,12 +486,6 @@ "type": "object", "error": "KCHVMSTOR0012E", "properties": { - "dev": { - "description": "The storage device name", - "type": "string", - "pattern": "^h|vd[b-z]$", - "error": "KCHVMSTOR0001E" - }, "type": { "description": "The storage type", "type": "string", diff --git a/src/kimchi/mockmodel.py b/src/kimchi/mockmodel.py index 8b58c36..aa8441e 100644 --- a/src/kimchi/mockmodel.py +++ b/src/kimchi/mockmodel.py @@ -801,13 +801,8 @@ class MockModel(object): except Exception as e: raise InvalidParameter("KCHVMSTOR0015E", {'error': e}) dom = self._get_vm(vm_name) - dev = params.get('dev', None) - if dev and dev in self.vmstorages_get_list(vm_name): - return OperationFailed( - "KCHVMSTOR0004E", {'dev_name': dev, 'vm_name': vm_name}) - if not dev: - index = len(dom.storagedevices.keys()) + 1 - params['dev'] = "hd" + string.ascii_lowercase[index] + index = len(dom.storagedevices.keys()) + 1 + params['dev'] = "hd" + string.ascii_lowercase[index]
vmdev = MockVMStorageDevice(params) dom.storagedevices[params['dev']] = vmdev diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py index 54e2685..4d6c0b2 100644 --- a/src/kimchi/model/vmstorages.py +++ b/src/kimchi/model/vmstorages.py @@ -174,26 +174,19 @@ class VMStoragesModel(object): return params['dev']
def _get_storage_device_name(self, vm_name, params): - if params.get('dev') is None: - bus_prefix = PREFIX_MAP[params['bus']] - dev_list = [dev for dev in self.get_list(vm_name) - if dev.startswith(bus_prefix)] - if len(dev_list) == 0: - params['dev'] = bus_prefix + 'a' - else: - dev_list.sort() - last_dev = dev_list.pop() - # TODO: Improve to device names "greater then" hdz - next_dev_letter_pos =\ - string.ascii_lowercase.index(last_dev[2]) + 1 - params['dev'] =\ - bus_prefix + string.ascii_lowercase[next_dev_letter_pos] - - devices = self.get_list(vm_name) - if params['dev'] in devices: - raise OperationFailed( - 'KCHVMSTOR0004E', Seems i18n.py needs to be updated to get 'KCHVMSTOR0004E' deleted. - {'dev_name': params['dev'], 'vm_name': vm_name}) + bus_prefix = PREFIX_MAP[params['bus']] + dev_list = [dev for dev in self.get_list(vm_name) + if dev.startswith(bus_prefix)] + if len(dev_list) == 0: + params['dev'] = bus_prefix + 'a' + else: + dev_list.sort() + last_dev = dev_list.pop() + # TODO: Improve to device names "greater then" hdz + next_dev_letter_pos =\ + string.ascii_lowercase.index(last_dev[2]) + 1 + params['dev'] =\ + bus_prefix + string.ascii_lowercase[next_dev_letter_pos]
def get_list(self, vm_name): dom = VMModel.get_vm(vm_name, self.conn) diff --git a/tests/test_model.py b/tests/test_model.py index ceedc6f..d458478 100644 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -356,11 +356,6 @@ class ModelTests(unittest.TestCase): self.assertEquals(u'cdrom', cd_info['type']) self.assertEquals(iso_path, cd_info['path'])
- # create a cdrom with existing dev_name - cdrom_args['dev'] = cdrom_dev - self.assertRaises(OperationFailed, inst.vmstorages_create, - vm_name, cdrom_args) - # update path of existing cd with # non existent iso self.assertRaises(InvalidParameter, inst.vmstorage_update, diff --git a/tests/test_rest.py b/tests/test_rest.py index 7778019..7eb6233 100644 --- a/tests/test_rest.py +++ b/tests/test_rest.py @@ -535,26 +535,23 @@ class RestTests(unittest.TestCase): self.assertEquals(400, resp.status)
# Attach disk with pool and vol specified - req = json.dumps({'dev': 'hdx', - 'type': 'disk', + req = json.dumps({'type': 'disk', 'pool': 'tmp', 'vol': 'attach-volume'}) resp = self.request('/vms/test-vm/storages', req, 'POST') self.assertEquals(201, resp.status) cd_info = json.loads(resp.read()) - self.assertEquals('hdx', cd_info['dev']) self.assertEquals('disk', cd_info['type']) self.assertEquals('tmp', cd_info['pool']) self.assertEquals('attach-volume', cd_info['vol'])
# Attach a cdrom with existent dev name - req = json.dumps({'dev': 'hdk', - 'type': 'cdrom', + req = json.dumps({'type': 'cdrom', 'path': '/tmp/existent.iso'}) resp = self.request('/vms/test-vm/storages', req, 'POST') self.assertEquals(201, resp.status) cd_info = json.loads(resp.read()) - self.assertEquals('hdk', cd_info['dev']) + cd_dev = cd_info['dev'] self.assertEquals('cdrom', cd_info['type']) self.assertEquals('/tmp/existent.iso', cd_info['path']) # Delete the file and cdrom @@ -564,7 +561,7 @@ class RestTests(unittest.TestCase):
# Change path of storage cdrom req = json.dumps({'path': 'http://myserver.com/myiso.iso'}) - resp = self.request('/vms/test-vm/storages/hdx', req, 'PUT') + resp = self.request('/vms/test-vm/storages/'+cd_dev, req, 'PUT') self.assertEquals(200, resp.status) cd_info = json.loads(resp.read()) self.assertEquals('http://myserver.com/myiso.iso', cd_info['path']) @@ -574,7 +571,8 @@ class RestTests(unittest.TestCase): self.assertEquals(4, len(devs))
# Detach storage cdrom - resp = self.request('/vms/test-vm/storages/hdx', '{}', 'DELETE') + resp = self.request('/vms/test-vm/storages/'+cd_dev, + '{}', 'DELETE') self.assertEquals(204, resp.status)
# Test GET
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
participants (3)
-
Aline Manera
-
Daniel Henrique Barboza
-
Royce Lv