[PATCH V3] [Wok 0/5] Fix issue #142
by Lucio Correia
Changes in V3:
Added patch 5. Other patches are the same already reviewed.
Lucio Correia (5):
Add option to get untranslated message text
Issue #142 - Translate request log at reading-time
Fix issue with converting message to unicode
Update tests
Fix ascii_dict and utf8_dict
src/wok/control/base.py | 13 ++++++------
src/wok/message.py | 32 ++++++++++++++++-------------
src/wok/reqlogger.py | 53 ++++++++++++++++++++++++++++++++++++++++---------
src/wok/root.py | 12 +++++------
src/wok/stringutils.py | 6 ++----
tests/test_api.py | 2 +-
6 files changed, 77 insertions(+), 41 deletions(-)
--
1.9.1
8 years, 4 months
[PATCH] [Wok] BugFix - session timeout dialog on login
by peterpnns@gmail.com
From: peterpennings <peterpnns(a)gmail.com>
This patch fixes the quickly appears of the session timeout dialog on successful login
peterpennings (2):
Wok BugFix - session message appearing on login
ui/js/src/wok.api.js | 3 +
1 file changed, 23 insertions(+)
--
2.5.0
8 years, 4 months
[PATCH V2] [Wok 0/2] Show error reason in log of failed user requests
by Lucio Correia
Changes in v2:
* removed getCode and getParams from exception
Lucio Correia (2):
Fix issue #140 - Add original exception to user request log message
Update tests
src/wok/control/base.py | 9 +++++++++
src/wok/exception.py | 1 +
src/wok/reqlogger.py | 33 ++++++++++++++++++++++++++++-----
src/wok/root.py | 7 ++++++-
tests/test_api.py | 4 ----
5 files changed, 44 insertions(+), 10 deletions(-)
--
1.9.1
8 years, 4 months
[PATCH] [Wok 0/3] Show error reason in log of failed user requests
by Lucio Correia
This patchset fixes issue #140.
Lucio Correia (3):
Update WokException to store code and args
Fix issue #140 - Add original exception to user request log message
Update tests
src/wok/control/base.py | 9 +++++++++
src/wok/exception.py | 7 +++++++
src/wok/reqlogger.py | 34 +++++++++++++++++++++++++++++-----
src/wok/root.py | 7 ++++++-
tests/test_api.py | 4 ----
5 files changed, 51 insertions(+), 10 deletions(-)
--
1.9.1
8 years, 4 months
[RFC] Do not delete storage pool with storage volumes assigned to guests
by Ramon Medeiros
Propose:
Return error when a storage pool is marked to be deleted, but it has a
storage volume assigned to it.
Issues:
1) Nowadays, to delete a storage pool, it must be inactive. To list
storage volumes, the storage pool need to be active, so, kimchi must
turn it on before querying. The issue is: The storage pool can be handle
this way? Can we get trouble with network pools, like nfs?
2) Querying storagevolumes by XML can generate a lot of errors. I did
the following algorithm:
Get storage pool path -> list all domains -> Compare if storage volumes
starts with storage pool path
But, not all volumes inside the directory of storage pool belongs to it
(there is a example of this case at unit tests). And, as kimchi will
support creating volumes outside a pool, this checking will not work.
How we can fix this?
--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn(a)br.ibm.com
8 years, 4 months
[PATCH v2] [Wok] Externalise the tab names and locale list
by pkulkark@linux.vnet.ibm.com
From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
The tab names (Wok, Host, Virtualization) should be
externalised. Also, the list of locales needs to be
externalised so that it is translatable based on the
language selected.
Signed-off-by: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
---
ui/js/src/wok.main.js | 7 +-
ui/pages/i18n.json.tmpl | 3 +
ui/pages/login.html.tmpl | 344 +++++++++++++++++++++++------------------------
3 files changed, 179 insertions(+), 175 deletions(-)
diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js
index 1d49c9e..1683c95 100644
--- a/ui/js/src/wok.main.js
+++ b/ui/js/src/wok.main.js
@@ -35,6 +35,7 @@ wok.main = function() {
var genTabs = function(tabs) {
var tabsHtml = [];
$(tabs).each(function(i, tab) {
+ tab_i18n = i18n[tab] ? i18n[tab] : tab;
var functionality = tab['functionality'];
var title = tab['title'];
var path = tab['path'];
@@ -58,11 +59,11 @@ wok.main = function() {
var genFuncTabs = function(tabs){
var functionalTabHtml = [];
- $(tabs).each(function(i, tab) {
+ $(tabs).each(function(i, tab_i18n) {
functionalTabHtml.push(
'<li>',
- '<a class="item',' ',tab.toLowerCase(),'Tab','" href="#">',
- tab,
+ '<a class="item',' ',tab_i18n.toLowerCase(),'Tab','" href="#">',
+ tab_i18n,
'</a>',
'</li>'
);
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index 5628479..aca2449 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -24,6 +24,9 @@
#silent _ = t.gettext
#silent _t = t.gettext
{
+ "Host": "$_("Host")",
+ "Virtualization": "$_("Virtualization")",
+ "Wok": "$_("Wok")",
"Settings": "$_("Settings")",
"WOKAPI6005E": "$_("No such data available.")",
diff --git a/ui/pages/login.html.tmpl b/ui/pages/login.html.tmpl
index 6890d9b..170f8fe 100644
--- a/ui/pages/login.html.tmpl
+++ b/ui/pages/login.html.tmpl
@@ -144,178 +144,178 @@
<div class="form-group">
<label for="userLocale">$_("Locale")</label>
<select id="userLocale" class="selectpicker col-md-12 col-lg-12">
- <option value="af-ZA">Afrikaans (South Africa)</option>
- <option value="sq-AL">Albanian (Albania)</option>
- <option value="am-ET">Amharic (Ethiopia)</option>
- <option value="ar-DZ">Arabic (Algeria)</option>
- <option value="ar-BH">Arabic (Bahrain)</option>
- <option value="ar-EG">Arabic (Egypt)</option>
- <option value="ar-IQ">Arabic (Iraq)</option>
- <option value="ar-JO">Arabic (Jordan)</option>
- <option value="ar-KW">Arabic (Kuwait)</option>
- <option value="ar-LB">Arabic (Lebanon)</option>
- <option value="ar-LY">Arabic (Libya)</option>
- <option value="ar-MR">Arabic (Mauritania)</option>
- <option value="ar-MA">Arabic (Morocco)</option>
- <option value="ar-OM">Arabic (Oman)</option>
- <option value="ar-QA">Arabic (Qatar)</option>
- <option value="ar-SA">Arabic (Saudi Arabia)</option>
- <option value="ar-SY">Arabic (Syria)</option>
- <option value="ar-TN">Arabic (Tunisia)</option>
- <option value="ar-AE">Arabic (United Arab Emirates)</option>
- <option value="ar-YE">Arabic (Yemen)</option>
- <option value="hy-AM">Armenian (Armenia)</option>
- <option value="as-IN">Assamese (India)</option>
- <option value="az-AZ">Azerbaijani (Azerbaijan)</option>
- <option value="eu-ES">Basque (Spain)</option>
- <option value="be-BY">Belarusian (Belarus)</option>
- <option value="bn-BD">Bengali (Bangladesh)</option>
- <option value="bn-IN">Bengali (India)</option>
- <option value="bs-BA">Bosnian (Bosnia)</option>
- <option value="bg-BG">Bulgarian (Bulgaria)</option>
- <option value="my-MM">Burmese (Myanmar)</option>
- <option value="ca-ES">Catalan (Spain)</option>
- <option value="zh-CN">Chinese-simplified (China)</option>
- <option value="zh-SG">Chinese-simplified (Singapore)</option>
- <option value="zh-HK">Chinese-traditional (Hong Kong S.A.R. of China)</option>
- <option value="zh-MO">Chinese-traditional (Macao)</option>
- <option value="zh-TW">Chinese-traditional (Taiwan)</option>
- <option value="hr-HR">Croatian (Croatia)</option>
- <option value="cs-CZ">Czech (Czech Republic)</option>
- <option value="da-DK">Danish (Denmark)</option>
- <option value="nl-BE">Dutch (Belgium)</option>
- <option value="nl-NL">Dutch (The Netherlands)</option>
- <option value="en-AU">English (Australia)</option>
- <option value="en-BE">English (Belgium)</option>
- <option value="en-CM">English (Cameroon)</option>
- <option value="en-CA">English (Canada)</option>
- <option value="en-GH">English (Ghana)</option>
- <option value="en-HK">English (Hong Kong S.A.R. of China)</option>
- <option value="en-IN">English (India)</option>
- <option value="en-IE">English (Ireland)</option>
- <option value="en-KE">English (Kenya)</option>
- <option value="en-MU">English (Mauritius)</option>
- <option value="en-NZ">English (New Zealand)</option>
- <option value="en-NG">English (Nigeria)</option>
- <option value="en-PH">English (Philippines)</option>
- <option value="en-SG">English (Singapore)</option>
- <option value="en-ZA">English (South Africa)</option>
- <option value="en-TZ">English (Tanzania)</option>
- <option value="en-GB">English (United Kingdom)</option>
- <option value="en-US">English (United States)</option>
- <option value="en-ZM">English (Zambia)</option>
- <option value="et-EE">Estonian (Estonia)</option>
- <option value="tl-PH">Filipino (Philippines)</option>
- <option value="fi-FI">Finnish (Finland)</option>
- <option value="fr-DZ">French (Algeria)</option>
- <option value="fr-CM">French (Cameroon)</option>
- <option value="fr-CD">French (Democratic Republic of the Congo)</option>
- <option value="fr-BE">French (Belgium)</option>
- <option value="fr-CA">French (Canada)</option>
- <option value="fr-FR">French (France)</option>
- <option value="fr-CI">French (Ivory Coast [Côte d’Ivoire])</option>
- <option value="fr-LU">French (Luxembourg)</option>
- <option value="fr-MR">French (Mauritania)</option>
- <option value="fr-MU">French (Mauritius)</option>
- <option value="fr-MA">French (Morocco)</option>
- <option value="fr-SN">French (Senegal)</option>
- <option value="fr-CH">French (Switzerland)</option>
- <option value="fr-TN">French (Tunisia)</option>
- <option value="gl-ES">Galician (Spain)</option>
- <option value="lg-UG">Ganda (Uganda)</option>
- <option value="ka-GE">Georgian (Georgia)</option>
- <option value="de-AT">German (Austria)</option>
- <option value="de-DE">German (Germany)</option>
- <option value="de-LU">German (Luxembourg)</option>
- <option value="de-CH">German (Switzerland)</option>
- <option value="el-GR">Greek (Greece)</option>
- <option value="gu-IN">Gujarati (India)</option>
- <option value="ha-NG">Hausa (Nigeria)</option>
- <option value="he-IL">Hebrew (Israel)</option>
- <option value="hi-IN">Hindi (India)</option>
- <option value="hu-HU">Hungarian (Hungary)</option>
- <option value="is-IS">Icelandic (Iceland)</option>
- <option value="ig-NG">Igbo (Nigeria)</option>
- <option value="id-ID">Indonesian (Indonesia)</option>
- <option value="it-IT">Italian (Italy)</option>
- <option value="it-CH">Italian (Switzerland)</option>
- <option value="ja-JP">Japanese (Japan)</option>
- <option value="kn-IN">Kannada (India)</option>
- <option value="kk-KZ">Kazakh (Kazakhstan)</option>
- <option value="km-KH">Khmer (Cambodia)</option>
- <option value="rw-RW">Kinyarwanda (Rwanda)</option>
- <option value="kok-IN">Konkani (India)</option>
- <option value="ko-KR">Korean (Korea, South)</option>
- <option value="lo-LA">Lao (Laos)</option>
- <option value="lv-LV">Latvian (Latvia)</option>
- <option value="lt-LT">Lithuanian (Lithuania)</option>
- <option value="mk-MK">Macedonian (Macedonia)</option>
- <option value="ms-MY">Malay-Latin (Malaysia)</option>
- <option value="ml-IN">Malayalam (India)</option>
- <option value="mt-MT">Maltese (Malta)</option>
- <option value="mr-IN">Marathi (India)</option>
- <option value="mn-Cyrl-MN">Mongolian-Cyrillic (Mongolia)</option>
- <option value="ne-IN">Nepali (India)</option>
- <option value="ne-NP">Nepali (Nepal)</option>
- <option value="nb-NO">Norwegian Bokmål (Norway)</option>
- <option value="nn-NO">Norwegian Nynorsk (Norway)</option>
- <option value="or-IN">Oriya [aka, Odia] (India)</option>
- <option value="om-ET">Oromo (Ethiopia)</option>
- <option value="pl-PL">Polish (Poland)</option>
- <option value="pt-AO">Portuguese (Angola)</option>
- <option value="pt-BR">Portuguese (Brazil)</option>
- <option value="pt-MO">Portuguese (Macao)</option>
- <option value="pt-MZ">Portuguese (Mozambique)</option>
- <option value="pt-PT">Portuguese (Portugal)</option>
- <option value="pa-IN">Punjabi (India)</option>
- <option value="ro-RO">Romanian (Romania)</option>
- <option value="ru-RU">Russian (Russia)</option>
- <option value="sr-RS">Serbian-Cyrillic (Serbia)</option>
- <option value="sr-ME">Serbian-Latin (Montenegro)</option>
- <option value="sr-Latn-RS">Serbian-Latin (Serbia)</option>
- <option value="si-LK">Sinhala (Sri Lanka)</option>
- <option value="sk-SK">Slovak (Slovakia)</option>
- <option value="sl-SI">Slovenian (Slovenia)</option>
- <option value="es-AR">Spanish (Argentina)</option>
- <option value="es-BO">Spanish (Bolivia)</option>
- <option value="es-CL">Spanish (Chile)</option>
- <option value="es-CO">Spanish (Colombia)</option>
- <option value="es-CR">Spanish (Costa Rica)</option>
- <option value="es-DO">Spanish (Dominican Republic)</option>
- <option value="es-EC">Spanish (Ecuador)</option>
- <option value="es-SV">Spanish (El Salvador)</option>
- <option value="es-GT">Spanish (Guatemala)</option>
- <option value="es-HN">Spanish (Honduras)</option>
- <option value="es-MX">Spanish (Mexico)</option>
- <option value="es-NI">Spanish (Nicaragua)</option>
- <option value="es-PA">Spanish (Panama)</option>
- <option value="es-PY">Spanish (Paraguay)</option>
- <option value="es-PE">Spanish (Peru)</option>
- <option value="es-PR">Spanish (Puerto Rico)</option>
- <option value="es-ES">Spanish (Spain)</option>
- <option value="es-US">Spanish (United States)</option>
- <option value="es-UY">Spanish (Uruguay)</option>
- <option value="es-VE">Spanish (Venezuela)</option>
- <option value="sw-KE">Swahili (Kenya)</option>
- <option value="sw-TZ">Swahili (Tanzania)</option>
- <option value="sv-SE">Swedish (Sweden)</option>
- <option value="ta-IN">Tamil (India)</option>
- <option value="te-IN">Telugu (India)</option>
- <option value="th-TH">Thai (Thailand)</option>
- <option value="tr-TR">Turkish (Turkey)</option>
- <option value="uk-UA">Ukrainian (Ukraine)</option>
- <option value="ur-IN">Urdu (India)</option>
- <option value="ur-PK">Urdu (Pakistan)</option>
- <option value="uz-Cyrl-UZ">Uzbek-Cyrillic (Uzbekistan)</option>
- <option value="uz-Latn-UZ">Uzbek-Latin (Uzbekistan)</option>
- <option value="vi-VN">Vietnamese (Vietnam)</option>
- <option value="cy-GB">Welsh (United Kingdom)</option>
- <option value="yo-NG">Yoruba (Nigeria)</option>
- <option value="zu-ZA">Zulu (South Africa)</option>
- <option value="az-AZ">Azerbaijani-Latin (Azerbaijan)</option>
- <option value="sr-CS">Serbian-Cyrillic ()</option>
- <option value="sr-Cyrl-CS">Serbian-Cyrillic (Serbia and Montenegro)</option>
- <option value="sr-Latn-CS">Serbian-Latin (Serbia and Montenegro)</option>
+ <option value="af-ZA">$_("Afrikaans (South Africa)")</option>
+ <option value="sq-AL">$_("Albanian (Albania)")</option>
+ <option value="am-ET">$_("Amharic (Ethiopia)")</option>
+ <option value="ar-DZ">$_("Arabic (Algeria)")</option>
+ <option value="ar-BH">$_("Arabic (Bahrain)")</option>
+ <option value="ar-EG">$_("Arabic (Egypt)")</option>
+ <option value="ar-IQ">$_("Arabic (Iraq)")</option>
+ <option value="ar-JO">$_("Arabic (Jordan)")</option>
+ <option value="ar-KW">$_("Arabic (Kuwait)")</option>
+ <option value="ar-LB">$_("Arabic (Lebanon)")</option>
+ <option value="ar-LY">$_("Arabic (Libya)")</option>
+ <option value="ar-MR">$_("Arabic (Mauritania)")</option>
+ <option value="ar-MA">$_("Arabic (Morocco)")</option>
+ <option value="ar-OM">$_("Arabic (Oman)")</option>
+ <option value="ar-QA">$_("Arabic (Qatar)")</option>
+ <option value="ar-SA">$_("Arabic (Saudi Arabia)")</option>
+ <option value="ar-SY">$_("Arabic (Syria)")</option>
+ <option value="ar-TN">$_("Arabic (Tunisia)")</option>
+ <option value="ar-AE">$_("Arabic (United Arab Emirates)")</option>
+ <option value="ar-YE">$_("Arabic (Yemen)")</option>
+ <option value="hy-AM">$_("Armenian (Armenia)")</option>
+ <option value="as-IN">$_("Assamese (India)")</option>
+ <option value="az-AZ">$_("Azerbaijani (Azerbaijan)")</option>
+ <option value="eu-ES">$_("Basque (Spain)")</option>
+ <option value="be-BY">$_("Belarusian (Belarus)")</option>
+ <option value="bn-BD">$_("Bengali (Bangladesh)")</option>
+ <option value="bn-IN">$_("Bengali (India)")</option>
+ <option value="bs-BA">$_("Bosnian (Bosnia)")</option>
+ <option value="bg-BG">$_("Bulgarian (Bulgaria)")</option>
+ <option value="my-MM">$_("Burmese (Myanmar)")</option>
+ <option value="ca-ES">$_("Catalan (Spain)")</option>
+ <option value="zh-CN">$_("Chinese-simplified (China)")</option>
+ <option value="zh-SG">$_("Chinese-simplified (Singapore)")</option>
+ <option value="zh-HK">$_("Chinese-traditional (Hong Kong S.A.R. of China)")</option>
+ <option value="zh-MO">$_("Chinese-traditional (Macao)")</option>
+ <option value="zh-TW">$_("Chinese-traditional (Taiwan)")</option>
+ <option value="hr-HR">$_("Croatian (Croatia)")</option>
+ <option value="cs-CZ">$_("Czech (Czech Republic)")</option>
+ <option value="da-DK">$_("Danish (Denmark)")</option>
+ <option value="nl-BE">$_("Dutch (Belgium)")</option>
+ <option value="nl-NL">$_("Dutch (The Netherlands)")</option>
+ <option value="en-AU">$_("English (Australia)")</option>
+ <option value="en-BE">$_("English (Belgium)")</option>
+ <option value="en-CM">$_("English (Cameroon)")</option>
+ <option value="en-CA">$_("English (Canada)")</option>
+ <option value="en-GH">$_("English (Ghana)")</option>
+ <option value="en-HK">$_("English (Hong Kong S.A.R. of China)")</option>
+ <option value="en-IN">$_("English (India)")</option>
+ <option value="en-IE">$_("English (Ireland)")</option>
+ <option value="en-KE">$_("English (Kenya)")</option>
+ <option value="en-MU">$_("English (Mauritius)")</option>
+ <option value="en-NZ">$_("English (New Zealand)")</option>
+ <option value="en-NG">$_("English (Nigeria)")</option>
+ <option value="en-PH">$_("English (Philippines)")</option>
+ <option value="en-SG">$_("English (Singapore)")</option>
+ <option value="en-ZA">$_("English (South Africa)")</option>
+ <option value="en-TZ">$_("English (Tanzania)")</option>
+ <option value="en-GB">$_("English (United Kingdom)")</option>
+ <option value="en-US">$_("English (United States)")</option>
+ <option value="en-ZM">$_("English (Zambia)")</option>
+ <option value="et-EE">$_("Estonian (Estonia)")</option>
+ <option value="tl-PH">$_("Filipino (Philippines)")</option>
+ <option value="fi-FI">$_("Finnish (Finland)")</option>
+ <option value="fr-DZ">$_("French (Algeria)")</option>
+ <option value="fr-CM">$_("French (Cameroon)")</option>
+ <option value="fr-CD">$_("French (Democratic Republic of the Congo)")</option>
+ <option value="fr-BE">$_("French (Belgium)")</option>
+ <option value="fr-CA">$_("French (Canada)")</option>
+ <option value="fr-FR">$_("French (France)")</option>
+ <option value="fr-CI">$_("French (Ivory Coast [Côte d’Ivoire])")</option>
+ <option value="fr-LU">$_("French (Luxembourg)")</option>
+ <option value="fr-MR">$_("French (Mauritania)")</option>
+ <option value="fr-MU">$_("French (Mauritius)")</option>
+ <option value="fr-MA">$_("French (Morocco)")</option>
+ <option value="fr-SN">$_("French (Senegal)")</option>
+ <option value="fr-CH">$_("French (Switzerland)")</option>
+ <option value="fr-TN">$_("French (Tunisia)")</option>
+ <option value="gl-ES">$_("Galician (Spain)")</option>
+ <option value="lg-UG">$_("Ganda (Uganda)")</option>
+ <option value="ka-GE">$_("Georgian (Georgia)")</option>
+ <option value="de-AT">$_("German (Austria)")</option>
+ <option value="de-DE">$_("German (Germany)")</option>
+ <option value="de-LU">$_("German (Luxembourg)")</option>
+ <option value="de-CH">$_("German (Switzerland)")</option>
+ <option value="el-GR">$_("Greek (Greece)")</option>
+ <option value="gu-IN">$_("Gujarati (India)")</option>
+ <option value="ha-NG">$_("Hausa (Nigeria)")</option>
+ <option value="he-IL">$_("Hebrew (Israel)")</option>
+ <option value="hi-IN">$_("Hindi (India)")</option>
+ <option value="hu-HU">$_("Hungarian (Hungary)")</option>
+ <option value="is-IS">$_("Icelandic (Iceland)")</option>
+ <option value="ig-NG">$_("Igbo (Nigeria)")</option>
+ <option value="id-ID">$_("Indonesian (Indonesia)")</option>
+ <option value="it-IT">$_("Italian (Italy)")</option>
+ <option value="it-CH">$_("Italian (Switzerland)")</option>
+ <option value="ja-JP">$_("Japanese (Japan)")</option>
+ <option value="kn-IN">$_("Kannada (India)")</option>
+ <option value="kk-KZ">$_("Kazakh (Kazakhstan)")</option>
+ <option value="km-KH">$_("Khmer (Cambodia)")</option>
+ <option value="rw-RW">$_("Kinyarwanda (Rwanda)")</option>
+ <option value="kok-IN">$_("Konkani (India)")</option>
+ <option value="ko-KR">$_("Korean (Korea, South)")</option>
+ <option value="lo-LA">$_("Lao (Laos)")</option>
+ <option value="lv-LV">$_("Latvian (Latvia)")</option>
+ <option value="lt-LT">$_("Lithuanian (Lithuania)")</option>
+ <option value="mk-MK">$_("Macedonian (Macedonia)")</option>
+ <option value="ms-MY">$_("Malay-Latin (Malaysia)")</option>
+ <option value="ml-IN">$_("Malayalam (India)")</option>
+ <option value="mt-MT">$_("Maltese (Malta)")</option>
+ <option value="mr-IN">$_("Marathi (India)")</option>
+ <option value="mn-Cyrl-MN">$_("Mongolian-Cyrillic (Mongolia)")</option>
+ <option value="ne-IN">$_("Nepali (India)")</option>
+ <option value="ne-NP">$_("Nepali (Nepal)")</option>
+ <option value="nb-NO">$_("Norwegian Bokmål (Norway)")</option>
+ <option value="nn-NO">$_("Norwegian Nynorsk (Norway)")</option>
+ <option value="or-IN">$_("Oriya [aka, Odia] (India)")</option>
+ <option value="om-ET">$_("Oromo (Ethiopia)")</option>
+ <option value="pl-PL">$_("Polish (Poland)")</option>
+ <option value="pt-AO">$_("Portuguese (Angola)")</option>
+ <option value="pt-BR">$_("Portuguese (Brazil)")</option>
+ <option value="pt-MO">$_("Portuguese (Macao)")</option>
+ <option value="pt-MZ">$_("Portuguese (Mozambique)")</option>
+ <option value="pt-PT">$_("Portuguese (Portugal)")</option>
+ <option value="pa-IN">$_("Punjabi (India)")</option>
+ <option value="ro-RO">$_("Romanian (Romania)")</option>
+ <option value="ru-RU">$_("Russian (Russia)")</option>
+ <option value="sr-RS">$_("Serbian-Cyrillic (Serbia)")</option>
+ <option value="sr-ME">$_("Serbian-Latin (Montenegro)")</option>
+ <option value="sr-Latn-RS">$_("Serbian-Latin (Serbia)")</option>
+ <option value="si-LK">$_("Sinhala (Sri Lanka)")</option>
+ <option value="sk-SK">$_("Slovak (Slovakia)")</option>
+ <option value="sl-SI">$_("Slovenian (Slovenia)")</option>
+ <option value="es-AR">$_("Spanish (Argentina)")</option>
+ <option value="es-BO">$_("Spanish (Bolivia)")</option>
+ <option value="es-CL">$_("Spanish (Chile)")</option>
+ <option value="es-CO">$_("Spanish (Colombia)")</option>
+ <option value="es-CR">$_("Spanish (Costa Rica)")</option>
+ <option value="es-DO">$_("Spanish (Dominican Republic)")</option>
+ <option value="es-EC">$_("Spanish (Ecuador)")</option>
+ <option value="es-SV">$_("Spanish (El Salvador)")</option>
+ <option value="es-GT">$_("Spanish (Guatemala)")</option>
+ <option value="es-HN">$_("Spanish (Honduras)")</option>
+ <option value="es-MX">$_("Spanish (Mexico)")</option>
+ <option value="es-NI">$_("Spanish (Nicaragua)")</option>
+ <option value="es-PA">$_("Spanish (Panama)")</option>
+ <option value="es-PY">$_("Spanish (Paraguay)")</option>
+ <option value="es-PE">$_("Spanish (Peru)")</option>
+ <option value="es-PR">$_("Spanish (Puerto Rico)")</option>
+ <option value="es-ES">$_("Spanish (Spain)")</option>
+ <option value="es-US">$_("Spanish (United States)")</option>
+ <option value="es-UY">$_("Spanish (Uruguay)")</option>
+ <option value="es-VE">$_("Spanish (Venezuela)")</option>
+ <option value="sw-KE">$_("Swahili (Kenya)")</option>
+ <option value="sw-TZ">$_("Swahili (Tanzania)")</option>
+ <option value="sv-SE">$_("Swedish (Sweden)")</option>
+ <option value="ta-IN">$_("Tamil (India)")</option>
+ <option value="te-IN">$_("Telugu (India)")</option>
+ <option value="th-TH">$_("Thai (Thailand)")</option>
+ <option value="tr-TR">$_("Turkish (Turkey)")</option>
+ <option value="uk-UA">$_("Ukrainian (Ukraine)")</option>
+ <option value="ur-IN">$_("Urdu (India)")</option>
+ <option value="ur-PK">$_("Urdu (Pakistan)")</option>
+ <option value="uz-Cyrl-UZ">$_("Uzbek-Cyrillic (Uzbekistan)")</option>
+ <option value="uz-Latn-UZ">$_("Uzbek-Latin (Uzbekistan)")</option>
+ <option value="vi-VN">$_("Vietnamese (Vietnam)")</option>
+ <option value="cy-GB">$_("Welsh (United Kingdom)")</option>
+ <option value="yo-NG">$_("Yoruba (Nigeria)")</option>
+ <option value="zu-ZA">$_("Zulu (South Africa)")</option>
+ <option value="az-AZ">$_("Azerbaijani-Latin (Azerbaijan)")</option>
+ <option value="sr-CS">$_("Serbian-Cyrillic ()")</option>
+ <option value="sr-Cyrl-CS">$_("Serbian-Cyrillic (Serbia and Montenegro)")</option>
+ <option value="sr-Latn-CS">$_("Serbian-Latin (Serbia and Montenegro)")</option>
</select>
</div>
</form>
--
2.1.0
8 years, 4 months
[PATCH] [Kimchi] Feature request (#860): Support Guest Autostart
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
Include 'autostart' option in API.json and vms.py (lookup and update)
using libvirt dom.setAutostart to set as true or false. Also edit
test_model.py to include those changes.
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
API.json | 4 ++++
model/vms.py | 12 +++++++++---
tests/test_model.py | 6 ++++++
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/API.json b/API.json
index 4fdd522..4946069 100644
--- a/API.json
+++ b/API.json
@@ -322,6 +322,10 @@
"error": "KCHVM0053E",
"type": "boolean"
},
+ "autostart": {
+ "description": "Enable/Disable guest autostart",
+ "type": "boolean"
+ },
"users": {
"description": "Array of users who have permission to the VM",
"type": "array",
diff --git a/model/vms.py b/model/vms.py
index 433770a..cfe4c97 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -79,11 +79,13 @@ DOM_STATE_MAP = {0: 'nostate',
7: 'pmsuspended'}
# update parameters which are updatable when the VM is online
-VM_ONLINE_UPDATE_PARAMS = ['graphics', 'groups', 'memory', 'users']
+VM_ONLINE_UPDATE_PARAMS = ['graphics', 'groups', 'memory', 'users',
+ 'autostart']
# update parameters which are updatable when the VM is offline
VM_OFFLINE_UPDATE_PARAMS = ['cpu_info', 'graphics', 'groups', 'memory',
- 'name', 'users', 'bootorder', 'bootmenu']
+ 'name', 'users', 'bootorder', 'bootmenu',
+ 'autostart']
XPATH_DOMAIN_DISK = "/domain/devices/disk[@device='disk']/source/@file"
XPATH_DOMAIN_DISK_BY_FILE = "./devices/disk[@device='disk']/source[@file='%s']"
@@ -261,6 +263,9 @@ class VMModel(object):
with lock:
dom = self.get_vm(name, self.conn)
+ if "autostart" in params:
+ dom.setAutostart(1 if params['autostart'] == True else 0)
+
# You can only change <maxMemory> offline, updating guest XML
if ("memory" in params) and ('maxmemory' in params['memory']) and\
(DOM_STATE_MAP[dom.info()[0]] != 'shutoff'):
@@ -1285,7 +1290,8 @@ class VMModel(object):
'access': 'full',
'persistent': True if dom.isPersistent() else False,
'bootorder': boot,
- 'bootmenu': bootmenu
+ 'bootmenu': bootmenu,
+ 'autostart': dom.autostart()
}
def _vm_get_disk_paths(self, dom):
diff --git a/tests/test_model.py b/tests/test_model.py
index 27225f8..7b1fbfe 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -1369,6 +1369,12 @@ class ModelTests(unittest.TestCase):
inst.vm_update(u'пeω-∨м', {"bootmenu": False})
self.assertEquals("no", inst.vm_lookup(u'пeω-∨м')['bootmenu'])
+ # enable/disable autostart
+ inst.vm_update(u'пeω-∨м', {"autostart": True})
+ self.assertEquals("yes", inst.vm_lookup(u'пeω-∨м')['autostart'])
+ inst.vm_update(u'пeω-∨м', {"autostart": False})
+ self.assertEquals("no", inst.vm_lookup(u'пeω-∨м')['autostart'])
+
def test_get_interfaces(self):
inst = model.Model('test:///default',
objstore_loc=self.tmp_store)
--
2.7.4
8 years, 4 months
[PATCH] [Kimchi] Include 'autostart' option in API.json and vms.py (lookup and update) using libvirt dom.setAutostart to set as true or false. Also edit test_model.py to include those changes.
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
API.json | 4 ++++
model/vms.py | 12 +++++++++---
tests/test_model.py | 6 ++++++
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/API.json b/API.json
index 4fdd522..4946069 100644
--- a/API.json
+++ b/API.json
@@ -322,6 +322,10 @@
"error": "KCHVM0053E",
"type": "boolean"
},
+ "autostart": {
+ "description": "Enable/Disable guest autostart",
+ "type": "boolean"
+ },
"users": {
"description": "Array of users who have permission to the VM",
"type": "array",
diff --git a/model/vms.py b/model/vms.py
index 433770a..cfe4c97 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -79,11 +79,13 @@ DOM_STATE_MAP = {0: 'nostate',
7: 'pmsuspended'}
# update parameters which are updatable when the VM is online
-VM_ONLINE_UPDATE_PARAMS = ['graphics', 'groups', 'memory', 'users']
+VM_ONLINE_UPDATE_PARAMS = ['graphics', 'groups', 'memory', 'users',
+ 'autostart']
# update parameters which are updatable when the VM is offline
VM_OFFLINE_UPDATE_PARAMS = ['cpu_info', 'graphics', 'groups', 'memory',
- 'name', 'users', 'bootorder', 'bootmenu']
+ 'name', 'users', 'bootorder', 'bootmenu',
+ 'autostart']
XPATH_DOMAIN_DISK = "/domain/devices/disk[@device='disk']/source/@file"
XPATH_DOMAIN_DISK_BY_FILE = "./devices/disk[@device='disk']/source[@file='%s']"
@@ -261,6 +263,9 @@ class VMModel(object):
with lock:
dom = self.get_vm(name, self.conn)
+ if "autostart" in params:
+ dom.setAutostart(1 if params['autostart'] == True else 0)
+
# You can only change <maxMemory> offline, updating guest XML
if ("memory" in params) and ('maxmemory' in params['memory']) and\
(DOM_STATE_MAP[dom.info()[0]] != 'shutoff'):
@@ -1285,7 +1290,8 @@ class VMModel(object):
'access': 'full',
'persistent': True if dom.isPersistent() else False,
'bootorder': boot,
- 'bootmenu': bootmenu
+ 'bootmenu': bootmenu,
+ 'autostart': dom.autostart()
}
def _vm_get_disk_paths(self, dom):
diff --git a/tests/test_model.py b/tests/test_model.py
index 27225f8..7b1fbfe 100644
--- a/tests/test_model.py
+++ b/tests/test_model.py
@@ -1369,6 +1369,12 @@ class ModelTests(unittest.TestCase):
inst.vm_update(u'пeω-∨м', {"bootmenu": False})
self.assertEquals("no", inst.vm_lookup(u'пeω-∨м')['bootmenu'])
+ # enable/disable autostart
+ inst.vm_update(u'пeω-∨м', {"autostart": True})
+ self.assertEquals("yes", inst.vm_lookup(u'пeω-∨м')['autostart'])
+ inst.vm_update(u'пeω-∨м', {"autostart": False})
+ self.assertEquals("no", inst.vm_lookup(u'пeω-∨м')['autostart'])
+
def test_get_interfaces(self):
inst = model.Model('test:///default',
objstore_loc=self.tmp_store)
--
2.7.4
8 years, 4 months
[PATCH] [Kimchi] Issue# 973 Display resource name in confirmation dialog
by Socorro Stoppler
From: Socorro <socorro(a)linux.vnet.ibm.com>
When confirmation dialogs are shown, also display the name of the resource being
acted on (i.e. guest name, network, storage, template) as part of the message
Signed-off-by: Socorro <socorro(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_main.js | 15 ++++++++++-----
ui/js/src/kimchi.network.js | 6 ++++--
ui/js/src/kimchi.storage_main.js | 8 +++++---
ui/js/src/kimchi.template_main.js | 5 +++--
ui/pages/i18n.json.tmpl | 20 ++++++++++----------
5 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index 9c1aa54..c3ac607 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -127,8 +127,10 @@ kimchi.vmpoweroff = function(event) {
var vm_id = vm.attr("id");
var vmObject = vm.data();
var vm_persistent = vmObject.persistent == true;
- var content_msg = vm_persistent ? i18n['KCHVM6003M'] :
- i18n['KCHVM6009M'];
+ var content_msg_1 = i18n['KCHVM6003M'].replace('%1', vm_id);
+ var content_msg_2 = i18n['KCHVM6009M'].replace('%1', vm_id);
+ var content_msg = vm_persistent ? content_msg_1 :
+ content_msg_2;
var settings = {
title: i18n['KCHVM6002M'],
content: content_msg,
@@ -153,9 +155,10 @@ kimchi.vmshutdown = function(event) {
var button = event.target;
var vm = $(button).closest('li[name=guest]');
var vm_id = vm.attr("id");
+ var confirmMessage = i18n['KCHVM6007M'].replace('%1', vm_id);
var settings = {
title: i18n['KCHVM6006M'],
- content: i18n['KCHVM6007M'],
+ content: confirmMessage,
confirm: i18n['KCHAPI6002M'],
cancel: i18n['KCHAPI6003M']
};
@@ -174,9 +177,10 @@ kimchi.vmreset = function(event) {
$(button).addClass('loading');
var vm = $(button).closest('li[name=guest]');
var vm_id = $(vm).attr("id");
+ var confirmMessage = i18n['KCHVM6005M'].replace('%1', vm_id);
var settings = {
title: i18n['KCHVM6004M'],
- content: i18n['KCHVM6005M'],
+ content: confirmMessage,
confirm: i18n['KCHAPI6002M'],
cancel: i18n['KCHAPI6003M']
};
@@ -204,9 +208,10 @@ kimchi.vmdelete = function(event) {
var button = event.target;
var vm = $(button).closest('li[name=guest]');
var vm_id = $(vm).attr("id");
+ var confirmMessage = i18n['KCHVM6001M'].replace('%1', vm_id);
var settings = {
title: i18n['KCHVM6008M'],
- content: i18n['KCHVM6001M'],
+ content: confirmMessage,
confirm: i18n['KCHAPI6002M'],
cancel: i18n['KCHAPI6003M']
};
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index ac6bf74..4359fdc 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -161,9 +161,10 @@ kimchi.addNetworkActions = function(network) {
return false;
}
if (!network.persistent) {
+ var confirmMessage = i18n['KCHNET6004M'].replace('%1', network.name);
var settings = {
title : i18n['KCHAPI6001M'],
- content : i18n['KCHNET6004M'],
+ content : confirmMessage,
confirm : i18n['KCHAPI6002M'],
cancel : i18n['KCHAPI6003M']
};
@@ -180,9 +181,10 @@ kimchi.addNetworkActions = function(network) {
if (network.state === "up" || network.in_use) {
return false;
}
+ var confirmMessage = i18n['KCHNET6002M'].replace('%1', network.name);
wok.confirm({
title : i18n['KCHAPI6006M'],
- content : i18n['KCHNET6002M'],
+ content : confirmMessage,
confirm : i18n['KCHAPI6002M'],
cancel : i18n['KCHAPI6003M']
}, function() {
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 6c99f93..d88c304 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -310,14 +310,15 @@ kimchi.storageBindClick = function() {
$('.pool-delete').on('click', function(event) {
event.preventDefault();
var $pool = $(this);
+ var poolName = $pool.data('name');
+ var confirmMessage = i18n['KCHPOOL6001M'].replace('%1', poolName);
var settings = {
title : i18n['KCHAPI6001M'],
- content : i18n['KCHPOOL6001M'],
+ content : confirmMessage,
confirm : i18n['KCHAPI6002M'],
cancel : i18n['KCHAPI6003M']
};
wok.confirm(settings, function() {
- var poolName = $pool.data('name');
kimchi.deleteStoragePool(poolName, function() {
kimchi.doListStoragePools();
}, function(err) {
@@ -339,9 +340,10 @@ kimchi.storageBindClick = function() {
$('.pool-deactivate').on('click', function(event) {
event.preventDefault();
var poolName = $(this).data('name');
+ var confirmMessage = i18n['KCHPOOL6012M'].replace('%1', poolName);
var settings = {
title : i18n['KCHAPI6001M'],
- content : i18n['KCHPOOL6012M'],
+ content : confirmMessage,
confirm : i18n['KCHAPI6002M'],
cancel : i18n['KCHAPI6003M']
};
diff --git a/ui/js/src/kimchi.template_main.js b/ui/js/src/kimchi.template_main.js
index 302d906..daf6fb1 100644
--- a/ui/js/src/kimchi.template_main.js
+++ b/ui/js/src/kimchi.template_main.js
@@ -124,14 +124,15 @@ kimchi.templateBindClick = function() {
$('.template-delete a').on('click', function(event) {
event.preventDefault();
var $template = $(this);
+ var templateName = $template.data('template');
+ var confirmMessage = i18n['KCHTMPL6003M'].replace('%1', templateName);
var settings = {
title: i18n['KCHAPI6001M'],
- content: i18n['KCHTMPL6003M'],
+ content: confirmMessage,
confirm: i18n['KCHAPI6002M'],
cancel: i18n['KCHAPI6003M']
};
wok.confirm(settings, function() {
- var templateName = $template.data('template');
kimchi.deleteTemplate(templateName, function() {
kimchi.doListTemplates();
}, function(err) {
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index a5185b1..d29a206 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -47,24 +47,24 @@
"KCHTMPL6001W": "$_("No ISO found")",
"KCHTMPL6002M": "$_("This may take a long time. Do you want to continue?")",
- "KCHTMPL6003M": "$_("This will permanently delete the template. Would you like to continue?")",
+ "KCHTMPL6003M": "$_("This will permanently delete the %1 template. Would you like to continue?")",
"KCHTMPL6004M": "$_("View Table")",
"KCHTMPL6005M": "$_("View Gallery")",
"KCHTMPL6006M": "$_("Not Available")",
"KCHTMPL6007M": "$_("Please check the invalid Storage Pools")",
- "KCHVM6001M": "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
+ "KCHVM6001M": "$_("This will delete the %1 virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
"KCHVM6002M": "$_("Power off Confirmation")",
"KCHVM6003M": "$_("This action may produce undesirable results, "
- "for example unflushed disk cache in the guest. "
+ "for example unflushed disk cache in the %1 guest. "
"Would you like to continue?")",
"KCHVM6004M": "$_("Reset Confirmation")",
"KCHVM6005M": "$_("There is a risk of data loss caused by reset without"
- " the guest OS shutdown. Would you like to continue?")",
+ " the %1 guest OS shutdown. Would you like to continue?")",
"KCHVM6006M": "$_("Shut Down Confirmation")",
- "KCHVM6007M": "$_("Note the guest OS may ignore this request. Would you like to continue?")",
+ "KCHVM6007M": "$_("Note the %1 guest OS may ignore this request. Would you like to continue?")",
"KCHVM6008M": "$_("Virtual Machine delete Confirmation")",
- "KCHVM6009M": "$_("This virtual machine is not persistent. Power Off will delete it. Continue?")",
+ "KCHVM6009M": "$_("The %1 virtual machine is not persistent. Power Off will delete it. Continue?")",
"KCHVM0001E": "$_("Input is not a number")",
"KCHVM0002E": "$_("Memory value cannot be higher than Max Memory value")",
@@ -89,11 +89,11 @@
"KCHVMED6012M": "$_("Following devices will be affected, confirm?")",
"KCHNET6001M": "$_("unavailable")",
- "KCHNET6002M": "$_("This action will interrupt network connectivity for any virtual machine that depend on this network.")",
- "KCHNET6004M": "$_("This network is not persistent. Instead of stop, this action will permanently delete it. Would you like to continue?")",
+ "KCHNET6002M": "$_("This action will interrupt network connectivity for any virtual machine that depend on the %1 network.")",
+ "KCHNET6004M": "$_("The %1 network is not persistent. Instead of stop, this action will permanently delete it. Would you like to continue?")",
"KCHNET6001W": "$_("The bridged VLAN tag may not work well with NetworkManager enabled. You should consider disabling it.")",
- "KCHPOOL6001M": "$_("This will permanently delete the storage pool. Would you like to continue?")",
+ "KCHPOOL6001M": "$_("This will permanently delete the %1 storage pool. Would you like to continue?")",
"KCHPOOL6002M": "$_("This storage pool is empty.")",
"KCHPOOL6003M": "$_("It will format your disk and you will loose any data in there, are you sure to continue? ")",
"KCHPOOL6004M": "$_("SCSI Fibre Channel")",
@@ -108,7 +108,7 @@
"KCHPOOL6006E": "$_("No logical device selected.")",
"KCHPOOL6009E": "$_("This is not a valid Server Name or IP. Please, modify it.")",
"KCHPOOL6011M": "$_("No available partitions found.")",
- "KCHPOOL6012M": "$_("This storage pool is not persistent. Instead of deactivate, this action will permanently delete it. Would you like to continue?")",
+ "KCHPOOL6012M": "$_("The %1 storage pool is not persistent. Instead of deactivate, this action will permanently delete it. Would you like to continue?")",
"KCHPOOL6013M": "$_("Unable to retrieve partitions information.")",
"KCHPOOL6014M": "$_("In progress...")",
"KCHPOOL6015M": "$_("Failed!")",
--
2.7.4
8 years, 4 months
[PATCH v2][Kimchi] Fix when calling error message in storagepool
by Ramon Medeiros
Error message was waiting a string with index "pool", instead of "name"
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
Changes:
v2:
Use poolname instead of pool.name()
model/storagevolumes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/model/storagevolumes.py b/model/storagevolumes.py
index 91e1c6b..7b2272b 100644
--- a/model/storagevolumes.py
+++ b/model/storagevolumes.py
@@ -284,7 +284,7 @@ class StorageVolumeModel(object):
def get_storagevolume(poolname, name, conn):
pool = StoragePoolModel.get_storagepool(poolname, conn)
if not pool.isActive():
- raise InvalidOperation("KCHVOL0006E", {'name': pool})
+ raise InvalidOperation("KCHVOL0006E", {'pool': poolname})
try:
return pool.storageVolLookupByName(name.encode("utf-8"))
except libvirt.libvirtError as e:
--
2.5.5
8 years, 4 months