[PATCH] [Kimchi] Fixed "Add Template" modal window alignment
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
nor alignment issues with kimchi.css and Add Template modal html
Samuel Guimarães (1):
Fixed "Add Template" modal window alignment
ui/css/kimchi.css | 18 +++++++++++++++++-
ui/css/src/modules/_templates.scss | 16 +++++++++++++++-
ui/js/src/kimchi.template_add_main.js | 2 +-
ui/pages/template-add.html.tmpl | 17 ++++++-----------
4 files changed, 39 insertions(+), 14 deletions(-)
--
1.9.3
8 years, 7 months
[PATCH] [Kimchi] Adding 'source_media' docs in docs/API.md
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
This attribute went through changes recently and none of
them, neither the previous usage before them, was
documented.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
docs/API.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/API.md b/docs/API.md
index 9d42c53..5fa722c 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -295,6 +295,10 @@ Represents a snapshot of the Virtual Machine's primary monitor.
* **GET**: Retrieve a summarized list of all defined Templates
* **POST**: Create a new Template
* name: The name of the Template. Used to identify the Template in this API
+ * source_media: dictionary. The type of media to be used in the installation.
+ * type: the type of the media. Values: 'netboot' and 'disk'.
+ * path: applicable for type = 'disk' only. Indicates the path of the
+ source media.
* os_distro *(optional)*: The operating system distribution
* os_version *(optional)*: The version of the operating system distribution
* memory *(optional)*: The memory parameters of the template, specify one
--
2.5.5
8 years, 7 months
[PATCH] [Kimchi 0/2] *** DEPENDS ON WOK SEARCH QUERY FIX *** filtering VEPA interfaces
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
This patch set filters the VEPA interfaces to be used
in network creation by eliminating the ConnectX-4
cards.
Unit tests, docs and UI changes included.
Daniel Henrique Barboza (2):
Filter VEPA interfaces: adding 'module' to interfaces API
Filter VEPA interfaces: JS changes
control/interfaces.py | 3 ++-
docs/API.md | 2 ++
tests/test_rest.py | 2 +-
ui/js/src/kimchi.api.js | 14 ++++++++++++++
ui/js/src/kimchi.network_add_main.js | 12 ++++++++++--
5 files changed, 29 insertions(+), 4 deletions(-)
--
2.5.5
8 years, 7 months
[PATCH] [Wok] Updated .pot and *.po files using update-po.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Updated .pot and *.po files to have all new
externalized strings.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
po/de_DE.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/en_US.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/es_ES.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/fr_FR.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/it_IT.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/ja_JP.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/ko_KR.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/pt_BR.po | 47 +++++++++++++++++++++++++++++++++++++++++++----
po/ru_RU.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/wok.pot | 46 ++++++++++++++++++++++++++++++++++++++++++----
po/zh_CN.po | 47 +++++++++++++++++++++++++++++++++++++++++++----
po/zh_TW.po | 46 ++++++++++++++++++++++++++++++++++++++++++----
12 files changed, 506 insertions(+), 48 deletions(-)
diff --git a/po/de_DE.po b/po/de_DE.po
index 70434b7..cceb050 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -78,6 +78,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "%(item)s konnten nicht im Datenspeicher gefunden werden"
@@ -112,6 +120,12 @@ msgstr "STACK"
msgid "Go to Homepage"
msgstr "Gehe zu Homepage"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "Keine solchen Daten verfügbar."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -125,9 +139,6 @@ msgstr "Abbrechen"
msgid "Confirm"
msgstr "Bestätigen"
-msgid "No such data available."
-msgstr "Keine solchen Daten verfügbar."
-
msgid "Loading..."
msgstr "Wird geladen..."
@@ -199,6 +210,12 @@ msgstr "Anmelden"
msgid "Logging in..."
msgstr "Wird angemeldet..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -222,3 +239,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/en_US.po b/po/en_US.po
index b150487..afee270 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: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -77,6 +77,14 @@ msgid "Creation of log file failed: %(err)s"
msgstr ""
#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
+#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr ""
@@ -108,6 +116,12 @@ msgstr ""
msgid "Go to Homepage"
msgstr ""
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr ""
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -119,9 +133,6 @@ msgstr ""
msgid "Confirm"
msgstr ""
-msgid "No such data available."
-msgstr ""
-
msgid "Loading..."
msgstr ""
@@ -191,6 +202,12 @@ msgstr ""
msgid "Logging in..."
msgstr ""
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -214,3 +231,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/es_ES.po b/po/es_ES.po
index fbaac01..1072d94 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -77,6 +77,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "No se puede encontrar %(item)s en el almacén de datos"
@@ -111,6 +119,12 @@ msgstr "PILA"
msgid "Go to Homepage"
msgstr "Ir a la página inicial"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "No hay datos de ese tipo disponibles."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -125,9 +139,6 @@ msgstr "Cancelar"
msgid "Confirm"
msgstr "Confirmar"
-msgid "No such data available."
-msgstr "No hay datos de ese tipo disponibles."
-
msgid "Loading..."
msgstr "Cargando..."
@@ -199,6 +210,12 @@ msgstr "Iniciar sesión"
msgid "Logging in..."
msgstr "Iniciando sesión..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -222,3 +239,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/fr_FR.po b/po/fr_FR.po
index 0cc7d0a..32d88e1 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2014-08-27 21:30+0000\n"
"Last-Translator: BobSynfig\n"
"Language-Team: French (http://www.transifex.com/projects/p/kimchi/language/"
@@ -80,6 +80,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "Impossible de trouver %(item)s dans le magasin de données"
@@ -114,6 +122,12 @@ msgstr "STACK"
msgid "Go to Homepage"
msgstr "Aller à la page d'accueil"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "De telles données ne sont pas disponibles."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -128,9 +142,6 @@ msgstr "Annuler"
msgid "Confirm"
msgstr "Confirmer"
-msgid "No such data available."
-msgstr "De telles données ne sont pas disponibles."
-
msgid "Loading..."
msgstr "Chargement en cours..."
@@ -202,6 +213,12 @@ msgstr "Se connecter"
msgid "Logging in..."
msgstr "En cours de connexion..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -225,3 +242,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/it_IT.po b/po/it_IT.po
index e4b9503..3627229 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -77,6 +77,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "Impossibile trovare %(item)s nell'archivio dati"
@@ -111,6 +119,12 @@ msgstr "STACK"
msgid "Go to Homepage"
msgstr "Vai alla home page"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "Dati indicati non disponibili."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -125,9 +139,6 @@ msgstr "Annulla"
msgid "Confirm"
msgstr "Conferma"
-msgid "No such data available."
-msgstr "Dati indicati non disponibili."
-
msgid "Loading..."
msgstr "Caricamento in corso..."
@@ -199,6 +210,12 @@ msgstr "Accedi"
msgid "Logging in..."
msgstr "Accesso in corso..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -222,3 +239,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/ja_JP.po b/po/ja_JP.po
index 3f1d7af..b992283 100644
--- a/po/ja_JP.po
+++ b/po/ja_JP.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -76,6 +76,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "%(item)s はデータ・ストアに見つかりません"
@@ -110,6 +118,12 @@ msgstr "スタック"
msgid "Go to Homepage"
msgstr "ホーム・ページに移動する"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "そのようなデータはありません。"
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -123,9 +137,6 @@ msgstr "取消"
msgid "Confirm"
msgstr "確認"
-msgid "No such data available."
-msgstr "そのようなデータはありません。"
-
msgid "Loading..."
msgstr "ロードしています..."
@@ -195,6 +206,12 @@ msgstr "ログイン"
msgid "Logging in..."
msgstr "ログインしています..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -218,3 +235,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/ko_KR.po b/po/ko_KR.po
index 1afff07..abe17ee 100644
--- a/po/ko_KR.po
+++ b/po/ko_KR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -75,6 +75,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "데이터 저장소에서 %(item)s을(를) 찾을 수 없습니다."
@@ -107,6 +115,12 @@ msgstr "스택"
msgid "Go to Homepage"
msgstr "홈 페이지로 이동"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "해당 데이터가 없습니다."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -120,9 +134,6 @@ msgstr "취소"
msgid "Confirm"
msgstr "확인"
-msgid "No such data available."
-msgstr "해당 데이터가 없습니다."
-
msgid "Loading..."
msgstr "로드 중..."
@@ -193,6 +204,12 @@ msgstr "로그인"
msgid "Logging in..."
msgstr "로그인 중..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -216,3 +233,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 2ce4843..081ab9d 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: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2015-03-23 12:57+0000\n"
"Last-Translator: Crístian Deives dos Santos Viana <cristiandeives@gmail."
"com>\n"
@@ -94,6 +94,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "Não foi possível encontrar %(item)s no datastore"
@@ -127,6 +135,12 @@ msgstr "PILHA"
msgid "Go to Homepage"
msgstr "Ir para a Página Inicial"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "Não há dados disponíveis."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -141,9 +155,6 @@ msgstr "Cancelar"
msgid "Confirm"
msgstr "Confirmar"
-msgid "No such data available."
-msgstr "Não há dados disponíveis."
-
msgid "Loading..."
msgstr "Carregando..."
@@ -214,6 +225,12 @@ msgstr "Entrar"
msgid "Logging in..."
msgstr "Entrando..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr "Peers"
@@ -237,3 +254,25 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+
+msgid "Search"
+msgstr ""
diff --git a/po/ru_RU.po b/po/ru_RU.po
index a1dd8b6..5bd9ba4 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2014-08-28 17:32+0000\n"
"Last-Translator: Aline Manera <aline.manera(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/kimchi/language/"
@@ -76,6 +76,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "Не найден %(item)s в хранилище данных"
@@ -108,6 +116,12 @@ msgstr "Стек"
msgid "Go to Homepage"
msgstr "Перейти на главную страницу"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "Нет таких данных."
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -121,9 +135,6 @@ msgstr "Отмена"
msgid "Confirm"
msgstr "Подтвердить"
-msgid "No such data available."
-msgstr "Нет таких данных."
-
msgid "Loading..."
msgstr "Загружается..."
@@ -193,6 +204,12 @@ msgstr "Войти"
msgid "Logging in..."
msgstr "Вход..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -216,3 +233,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/wok.pot b/po/wok.pot
index 9e136c9..657c663 100755
--- a/po/wok.pot
+++ b/po/wok.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -77,6 +77,14 @@ msgid "Creation of log file failed: %(err)s"
msgstr ""
#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
+#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr ""
@@ -108,6 +116,12 @@ msgstr ""
msgid "Go to Homepage"
msgstr ""
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr ""
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -119,9 +133,6 @@ msgstr ""
msgid "Confirm"
msgstr ""
-msgid "No such data available."
-msgstr ""
-
msgid "Loading..."
msgstr ""
@@ -191,6 +202,12 @@ msgstr ""
msgid "Logging in..."
msgstr ""
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -214,3 +231,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 690c4d6..2891d4d 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: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-06-27 10:48+0000\n"
"Last-Translator: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
"Language-Team: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
@@ -92,6 +92,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "在数据存储中找不到%(item)s"
@@ -124,6 +132,12 @@ msgstr "调用栈"
msgid "Go to Homepage"
msgstr "返回主页"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "没有可用的数据"
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -136,9 +150,6 @@ msgstr "取消"
msgid "Confirm"
msgstr "确认"
-msgid "No such data available."
-msgstr "没有可用的数据"
-
msgid "Loading..."
msgstr "正在加载..."
@@ -208,6 +219,12 @@ msgstr "登录"
msgid "Logging in..."
msgstr "登录中..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr "对等机"
@@ -231,3 +248,25 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+
+msgid "Search"
+msgstr ""
diff --git a/po/zh_TW.po b/po/zh_TW.po
index ca537e1..47ff20a 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-03-23 16:14-0300\n"
+"POT-Creation-Date: 2016-05-11 08:43+0200\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -75,6 +75,14 @@ msgstr ""
msgid "Creation of log file failed: %(err)s"
msgstr ""
+#, python-format
+msgid "Unable to find notification %(id)s"
+msgstr ""
+
+#, python-format
+msgid "Unable to delete notification %(id)s: %(message)s"
+msgstr ""
+
#, python-format
msgid "Unable to find %(item)s in datastore"
msgstr "在資料儲存庫中找不到 %(item)s"
@@ -107,6 +115,12 @@ msgstr "堆疊"
msgid "Go to Homepage"
msgstr "跳至首頁"
+msgid "Settings"
+msgstr ""
+
+msgid "No such data available."
+msgstr "沒有此類可用資料。"
+
msgid ""
"Can not contact the host system. Verify the host system is up and that you "
"have network connectivity to it. HTTP request response %1. "
@@ -120,9 +134,6 @@ msgstr "取消 "
msgid "Confirm"
msgstr "確認"
-msgid "No such data available."
-msgstr "沒有此類可用資料。"
-
msgid "Loading..."
msgstr "正在載入..."
@@ -192,6 +203,12 @@ msgstr "登入"
msgid "Logging in..."
msgstr "正在登入..."
+msgid "Language"
+msgstr ""
+
+msgid "Locale"
+msgstr ""
+
msgid "Peers"
msgstr ""
@@ -215,3 +232,24 @@ msgstr ""
msgid "Powered by"
msgstr ""
+
+msgid "User Activity Log"
+msgstr ""
+
+msgid "Advanced Search"
+msgstr ""
+
+msgid "Download"
+msgstr ""
+
+msgid "Reset To Default"
+msgstr ""
+
+msgid "Search results by:"
+msgstr ""
+
+msgid "Request Type"
+msgstr ""
+
+msgid "Search"
+msgstr ""
--
1.8.3.1
8 years, 7 months
[Wok][PATCH v2 0/7] Multi-Culture Support
by pkulkark@linux.vnet.ibm.com
From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
This patch set provides multi-culture
support by adding another drop down
list during login for user locale
selection. The numeric data and datetime
fields are formatted based on the locale
selected.
Pooja Kulkarni (7):
Multi-Culture Support - Add a separate drop down list for locale
Multi-Culture support - Add methods to get and set locales in
wok.lang.js
Multi-Culture support - Add locale in format settings in
wok.line-chart.js
Multi-Culture support : Format datetime as per locale in wok.list.js
Multi-Culture support : Implement new drop down list for locale in
wok.login.js
Multi-Culture support : Modify wok.formatMeasurement util to include
formatting based on locale
Multi-Culture support : Format datetime in user activity log as per
locale
ui/js/src/wok.lang.js | 8 ++++++++
ui/js/src/wok.line-chart.js | 3 ++-
ui/js/src/wok.list.js | 6 +++++-
ui/js/src/wok.login.js | 9 +++++++++
ui/js/src/wok.utils.js | 10 +++++++---
ui/js/wok.bootgrid.js | 10 +++++++++-
ui/js/wok.user-log.js | 3 ++-
ui/pages/login.html.tmpl | 34 ++++++++++++++++++++++++++++++++++
8 files changed, 76 insertions(+), 7 deletions(-)
--
2.1.0
8 years, 7 months
[PATCH V3] [Wok 0/7] Multi-Culture Support Changes
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
V3 patches for muti-culture support
which includes formatting of
date, time, datetime, number
and addition dropdown to select
locale in login page. Also handle
the command modificationis suggested.
Archana Singh (7):
Multi-Culture Support - Add a separate drop down list for locale
Multi-Culture support - Add methods to get and set locales in
wok.lang.js
Multi-Culture support - Add locale in format settings in
wok.line-chart.js
Multi-Culture support : Added support for converters in widget
wok.list.js
Multi-Culture support : Implement new drop down list for locale in
wok.login.js
Multi-Culture support : Modify util to include formatting based on
locale
Multi-Culture support : Added support to add converters to bootgrid
ui/js/src/wok.lang.js | 16 +++++++++++++
ui/js/src/wok.line-chart.js | 3 ++-
ui/js/src/wok.list.js | 12 +++++++++-
ui/js/src/wok.login.js | 15 ++++++++++--
ui/js/src/wok.utils.js | 46 +++++++++++++++++++++++++++++++++++--
ui/js/wok.bootgrid.js | 8 ++++---
ui/js/wok.user-log.js | 8 +++----
ui/pages/login.html.tmpl | 56 ++++++++++++++++++++++++++++++++++-----------
8 files changed, 138 insertions(+), 26 deletions(-)
--
1.8.3.1
8 years, 7 months
[PATCH] [WoK] Fixing WoK match in search queries
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
Prior to this patch, supposing an example with the VMs API
of Kimchi, we could send a GET request like this:
/plugins/kimchi/vms?state=thisisnotrunning
and get as a answer all the VMs with state=running. The reason
was that WoK was doing a membership verification in the input
value even if the value isn't a list and, in this case,
'running' in 'thisisnotrunning' was returning True and the
VM would be added to the returned results.
This also impacted regular expressions with negative lookahead.
Using the same API mentioned above, a search query like
'state=^(?!running).*$' would return all VMs because if
state was not 'running' it would match this regex and, if
it was 'running', it would match this membership rule because
'running' in '^(?!running).*$' returns True.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
src/wok/control/base.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/wok/control/base.py b/src/wok/control/base.py
index f314d18..29b43ac 100644
--- a/src/wok/control/base.py
+++ b/src/wok/control/base.py
@@ -392,8 +392,9 @@ class Collection(object):
continue
if all(key in res.data and
- (res.data[key] == val or res.data[key] in val or
- re.match(str(val), res.data[key]))
+ (res.data[key] == val or
+ re.match(str(val), res.data[key]) or
+ (isinstance(val, list) and res.data[key] in val))
for key, val in fields_filter.iteritems()):
data.append(res.data)
return data
--
2.5.5
8 years, 7 months
[RFC] How to filter certain interfaces for VEPA in the UI
by Daniel Henrique Barboza
Hi there,
I want to filter the interfaces listing in the UI when creating VEPA
networks.
Reason is that some network cards (you got it right - ConnectX-4 !!) does
not have support for this kind of network yet.
Looking in the backend/UI code I want to discuss possible ways of filtering
a collection listing. For the sake of this discussion let's assume that the
'module' parameter (the kernel module that loaded the interface) is already
available at /plugins/kimchi/network/interfaces API:
(1) use query strings. For example, '/plugins/kimchi/vms?state=running'
would
list only the VMs that are running. Problem is that AFAIK I can't use a
query
string to say "I want all VMs but the ones running" or something like
/plugins/kimchi/vms?state!=running. To do that I would need to first
list all
VMs then list the running VMs and do list_all - list_running . Or, in our
case, list_all - list_connectx4.
(2) Implement it in JS. There are functions like 'loadInterfaces' which
receives
a filter option to get specific elements. It's easy to simply implement a
'loadVEPAInterfaces' and filter everything there. It wouldn't require to
fire 2 GET requests and do a list operation to exclude the interfaces.
We can
simply work with the interfaces returned from the 'all' listing.
My issues with (1) and (2) is that I feel I am putting too much logic in
UI code. Suppose that the criteria for VEPA networks changes and now
it's not a simple matter of excluding the interfaces with module=mlx5_core.
What then?
A backend solution would be, for example:
(3) Add a new parameter called 'vepa_capable' in network/interfaces API,
then
a simple call to /plugins/kimchi/network/interfaces?vepa_capable=true would
return the information, with a single GET call, in a way that the UI
would be
oblivious of what's going on in the backend. We can change the backend logic
anytime without messing with the UI calls
Of all these approaches I like (3) more, but not by far. This is why I
want to hear
options and perhaps other ideas aside from these 3.
Thanks,
Daniel
8 years, 7 months
[PATCH] [Kimchi] Add support to Libvirt Events.
by pvital@linux.vnet.ibm.com
From: Paulo Vital <pvital(a)linux.vnet.ibm.com>
This patch adds support to handle in Kimchi any Libvirt Event, just by adding
a callback to process the event and register the event with the callback.
None event is being registered by this patch and they need be added by developer
by demand in the code. To see how register an event, the unit test
test_libvirtevents.py register two events and then use them in the code.
Signed-off-by: Paulo Vital <pvital(a)linux.vnet.ibm.com>
---
i18n.py | 4 +
model/libvirtevents.py | 60 ++++++++++++++
model/model.py | 5 +-
tests/test_libvirtevents.py | 196 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 264 insertions(+), 1 deletion(-)
create mode 100644 model/libvirtevents.py
create mode 100644 tests/test_libvirtevents.py
diff --git a/i18n.py b/i18n.py
index 39f5e57..569f84d 100644
--- a/i18n.py
+++ b/i18n.py
@@ -331,4 +331,8 @@ messages = {
"KCHLVMS0001E": _("Invalid volume group name parameter: %(name)s."),
+ "KCHEVENT0001E": _("Failed to register the default event implementation."),
+ "KCHEVENT0002E": _("Failed to register timeout event."),
+ "KCHEVENT0003E": _("Failed to Run the default event implementation."),
+
}
diff --git a/model/libvirtevents.py b/model/libvirtevents.py
new file mode 100644
index 0000000..710840a
--- /dev/null
+++ b/model/libvirtevents.py
@@ -0,0 +1,60 @@
+#
+# Project Kimchi
+#
+# Copyright IBM Corp, 2016
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import cherrypy
+import libvirt
+import time
+
+from wok.exception import OperationFailed
+from wok.utils import wok_log
+
+
+class LibvirtEvents(object):
+ def __init__(self):
+ # Register default implementation of event handlers
+ if libvirt.virEventRegisterDefaultImpl() < 0:
+ raise OperationFailed('KCHEVENT0001E')
+
+ # Run a background thread with the event loop. Using cherrypy
+ # BackgroundTask class due to issues when using threading module with
+ # cherrypy.
+ self.event_loop_thread = cherrypy.process.plugins.BackgroundTask(
+ 2,
+ self._event_loop_run
+ )
+ self.event_loop_thread.setName('KimchiLibvirtEventLoop')
+ self.event_loop_thread.setDaemon(True)
+ self.event_loop_thread.start()
+
+ # Set an event timeout to control the self._event_loop_run
+ if libvirt.virEventAddTimeout(0, self._kimchi_EventTimeout, None) < 0:
+ raise OperationFailed('KCHEVENT0002E')
+
+ # Event loop method to be executed in background as thread
+ def _event_loop_run(self):
+ while True:
+ if libvirt.virEventRunDefaultImpl() < 0:
+ raise OperationFailed('KCHEVENT0003E')
+
+ def is_event_loop_alive(self):
+ return self.event_loop_thread.isAlive()
+
+ # Event loop handler used to limit length of waiting for any other event.
+ def _kimchi_EventTimeout(self, timer, opaque):
+ time.sleep(1)
diff --git a/model/model.py b/model/model.py
index e44f804..ed474d2 100644
--- a/model/model.py
+++ b/model/model.py
@@ -26,6 +26,7 @@ from wok.plugins.kimchi import config
from wok.utils import import_module, listPathModules
from wok.plugins.kimchi.model.libvirtconnection import LibvirtConnection
+from wok.plugins.kimchi.model.libvirtevents import LibvirtEvents
class Model(BaseModel):
@@ -43,8 +44,10 @@ class Model(BaseModel):
return instances
self.objstore = ObjectStore(objstore_loc or config.get_object_store())
+ self.events = LibvirtEvents()
self.conn = LibvirtConnection(libvirt_uri)
- kargs = {'objstore': self.objstore, 'conn': self.conn}
+ kargs = {'objstore': self.objstore, 'conn': self.conn,
+ 'eventsloop': self.events}
models = []
# Import task model from Wok
diff --git a/tests/test_libvirtevents.py b/tests/test_libvirtevents.py
new file mode 100644
index 0000000..4994776
--- /dev/null
+++ b/tests/test_libvirtevents.py
@@ -0,0 +1,196 @@
+# -*- coding: utf-8 -*-
+#
+# Project Kimchi
+#
+# Copyright IBM Corp, 2016
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+import libvirt
+import os
+import shutil
+import time
+import unittest
+
+import tests.utils as utils
+
+from wok.basemodel import Singleton
+from wok.rollbackcontext import RollbackContext
+
+from wok.plugins.kimchi.model import model
+
+import iso_gen
+
+
+TMP_DIR = '/var/lib/kimchi/tests/'
+UBUNTU_ISO = TMP_DIR + 'ubuntu14.04.iso'
+EVENT_ID = 0
+
+
+def setUpModule():
+ if not os.path.exists(TMP_DIR):
+ os.makedirs(TMP_DIR)
+
+ iso_gen.construct_fake_iso(UBUNTU_ISO, True, '14.04', 'ubuntu')
+
+ # Some FeatureTests functions depend on server to validate their result.
+ # As CapabilitiesModel is a Singleton class it will get the first result
+ # from FeatureTests which may be wrong when using the Model instance
+ # directly - the case of this test_model.py
+ # So clean Singleton instances to make sure to get the right result when
+ # running the following tests.
+ Singleton._instances = {}
+
+
+def tearDownModule():
+ shutil.rmtree(TMP_DIR)
+
+
+def get_next_event_id():
+ global EVENT_ID
+ EVENT_ID += 1
+ return EVENT_ID
+
+
+def get_event_id():
+ global EVENT_ID
+ return EVENT_ID
+
+
+class LibvirtEventsTests(unittest.TestCase):
+ def setUp(self):
+ self.tmp_store = '/tmp/kimchi-store-test'
+
+ def tearDown(self):
+ os.unlink(self.tmp_store)
+
+ def domain_event_lifecycle_cb(self, conn, dom, event, detail, *args):
+ """
+ Callback to handle Domain (VMs) events - VM Livecycle.
+ """
+ evStrings = ("Defined", "Undefined", "Started", "Suspended", "Resumed",
+ "Stopped", "Shutdown", "PMSuspended", "Crashed")
+ evDetails = (("Added", "Updated"),
+ ("Removed", ),
+ ("Booted", "Migrated", "Restored", "Snapshot", "Wakeup"),
+ ("Paused", "Migrated", "IOError", "Watchdog", "Restored",
+ "Snapshot", "API error"),
+ ("Unpaused", "Migrated", "Snapshot"),
+ ("Shutdown", "Destroyed", "Crashed", "Migrated", "Saved",
+ "Failed", "Snapshot"),
+ ("Finished", ),
+ ("Memory", "Disk"),
+ ("Panicked"))
+
+ json = {'domain': dom.name(), 'event': evStrings[event],
+ 'event_detail': evDetails[event][detail]}
+ with self.objstore as session:
+ session.store('libvirt-event', get_next_event_id(), json)
+
+ def domain_event_reboot_cb(self, conn, dom, *args):
+ """
+ Callback to handle Domain (VMs) events - VM Reboot.
+ """
+ json = {'domain': dom.name(), 'event': 'Rebooted'}
+ with self.objstore as session:
+ session.store('libvirt-event', get_next_event_id(), json)
+
+ @unittest.skipUnless(utils.running_as_root(), 'Must be run as root')
+ def test_events_vm_lifecycle(self):
+ inst = model.Model(objstore_loc=self.tmp_store)
+ self.objstore = inst.objstore
+
+ # Register the most common Libvirt domain events to be handled.
+ conn = inst.conn.get()
+ event_map = [(libvirt.VIR_DOMAIN_EVENT_ID_LIFECYCLE,
+ self.domain_event_lifecycle_cb),
+ (libvirt.VIR_DOMAIN_EVENT_ID_REBOOT,
+ self.domain_event_reboot_cb)]
+
+ for event, event_cb in event_map:
+ try:
+ conn.domainEventRegisterAny(None, event, event_cb, None)
+ except libvirt.libvirtError as e:
+ # It's not a big deal if an event could not be registered.
+ print "Could not register event %s. Details: %s" % (event, e)
+
+ # Create a template and VM to test, and start lifecycle tests
+ with RollbackContext() as rollback:
+ template_params = {'name': 'test',
+ 'source_media': {'type': 'disk',
+ 'path': UBUNTU_ISO}}
+
+ inst.templates_create(template_params)
+ rollback.prependDefer(inst.template_delete, 'test')
+
+ vm_params = {'name': 'kimchi-vm1',
+ 'template': '/plugins/kimchi/templates/test'}
+ task = inst.vms_create(vm_params)
+ inst.task_wait(task['id'], 10)
+ task = inst.task_lookup(task['id'])
+ self.assertEquals('finished', task['status'])
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Defined', res['event'])
+ self.assertEquals('Added', res['event_detail'])
+
+ inst.vm_start('kimchi-vm1')
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Started', res['event'])
+ self.assertEquals('Booted', res['event_detail'])
+
+ inst.vm_suspend('kimchi-vm1')
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Suspended', res['event'])
+ self.assertEquals('Paused', res['event_detail'])
+
+ inst.vm_resume('kimchi-vm1')
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Resumed', res['event'])
+ self.assertEquals('Unpaused', res['event_detail'])
+
+ inst.vm_reset('kimchi-vm1')
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Rebooted', res['event'])
+
+ inst.vm_poweroff('kimchi-vm1')
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Stopped', res['event'])
+ self.assertEquals('Destroyed', res['event_detail'])
+
+ inst.vm_delete('kimchi-vm1')
+ time.sleep(5)
+ with self.objstore as session:
+ res = session.get('libvirt-event', get_event_id())
+ self.assertEquals('kimchi-vm1', res['domain'])
+ self.assertEquals('Undefined', res['event'])
+ self.assertEquals('Removed', res['event_detail'])
--
2.5.5
8 years, 7 months
[PATCH V2] [Wok] Save notifications in memory instead of object store
by Lucio Correia
Notifications are temporary data structure, so save it in
memory instead of object store, allowing it to work even
when there is no disk space.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
src/wok/model/notifications.py | 52 ++++++++++++++++++++++++++++++------------
src/wok/objectstore.py | 36 -----------------------------
src/wok/server.py | 4 ----
3 files changed, 38 insertions(+), 54 deletions(-)
Changes in V2:
* Do not log notification delete requests
diff --git a/src/wok/model/notifications.py b/src/wok/model/notifications.py
index 77184db..79bed03 100644
--- a/src/wok/model/notifications.py
+++ b/src/wok/model/notifications.py
@@ -17,40 +17,64 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+from datetime import datetime
+
from wok.exception import NotFoundError, OperationFailed
from wok.message import WokMessage
+from wok.utils import wok_log
+
+
+notificationsStore = {}
+
+
+def add_notification(code, args={}, plugin_name=None):
+ if not code:
+ wok_log.error("Unable to add notification: invalid code '%(code)s'" %
+ {'code': str(code)})
+ return
+
+ global notificationsStore
+ notification = notificationsStore.get(code)
+
+ # do not update timestamp if notification already exists
+ timestamp = datetime.now().isoformat() if notification is None else \
+ notification['timestamp']
+
+ args.update({"_plugin_name": plugin_name, "timestamp": timestamp})
+ notificationsStore[code] = args
class NotificationsModel(object):
def __init__(self, **kargs):
- self.objstore = kargs['objstore']
+ pass
def get_list(self):
- with self.objstore as session:
- return session.get_list('notification')
+ global notificationsStore
+ return notificationsStore.keys()
class NotificationModel(object):
def __init__(self, **kargs):
- self.objstore = kargs['objstore']
+ pass
def lookup(self, id):
- with self.objstore as session:
- notification = session.get('notification', str(id))
+ global notificationsStore
+ notification = notificationsStore.get(str(id))
- # use WokMessage to translate the notification
- if notification:
- timestamp = notification['timestamp']
- plugin = notification.pop('_plugin_name', None)
- message = WokMessage(id, notification, plugin).get_text()
- return {"code": id, "message": message, "timestamp": timestamp}
+ # use WokMessage to translate the notification
+ if notification:
+ timestamp = notification['timestamp']
+ plugin = notification.pop('_plugin_name', None)
+ message = WokMessage(str(id), notification, plugin).get_text()
+ return {"code": id, "message": message, "timestamp": timestamp}
raise NotFoundError("WOKNOT0001E", {'id': str(id)})
def delete(self, id):
+ global notificationsStore
+
try:
- with self.objstore as session:
- session.delete('notification', str(id))
+ del notificationsStore[str(id)]
except Exception as e:
raise OperationFailed("WOKNOT0002E", {'id': str(id),
'msg': e.msg()})
diff --git a/src/wok/objectstore.py b/src/wok/objectstore.py
index ff3796c..59354f3 100644
--- a/src/wok/objectstore.py
+++ b/src/wok/objectstore.py
@@ -23,8 +23,6 @@ import sqlite3
import threading
import traceback
-from datetime import datetime
-
try:
from collections import OrderedDict
except ImportError:
@@ -146,37 +144,3 @@ class ObjectStore(object):
# exception again
wok_log.error(traceback.format_exc())
return False
-
-
-def add_notification(code, args={}, plugin_name=None):
- if not code:
- wok_log.error("Unable to add notification: invalid code '%(code)s'" %
- {'code': str(code)})
- return
-
- try:
- with ObjectStore() as session:
- notification = session.get('notification', code)
- except NotFoundError:
- notification = None
-
- try:
- # do not update timestamp if notification already exists
- timestamp = datetime.now().isoformat() if notification is None else \
- notification['timestamp']
- args.update({"_plugin_name": plugin_name, "timestamp": timestamp})
-
- with ObjectStore() as session:
- session.store('notification', code, args)
- except Exception as e:
- wok_log.error("Unable to store notification: %s" % e.message)
-
-
-def clean_notifications():
- try:
- with ObjectStore() as session:
- notifications = session.get_list('notification')
- for item in notifications:
- session.delete('notification', item)
- except Exception as e:
- wok_log.error("Unable to clean notifications: %s" % e.message)
diff --git a/src/wok/server.py b/src/wok/server.py
index a329ed4..902d4bf 100644
--- a/src/wok/server.py
+++ b/src/wok/server.py
@@ -33,7 +33,6 @@ from wok.config import config as configParser
from wok.config import paths, PluginConfig, WokConfig
from wok.control import sub_nodes
from wok.model import model
-from wok.objectstore import clean_notifications
from wok.proxy import start_proxy, terminate_proxy
from wok.reqlogger import RequestLogger
from wok.root import WokRoot
@@ -107,9 +106,6 @@ class Server(object):
if dev_env:
cherrypy.log.screen = True
- # clean object store notifications
- clean_notifications()
-
# close standard file handlers because we are going to use a
# watchedfiled handler, otherwise we will have two file handlers
# pointing to the same file, duplicating log enries
--
1.9.1
8 years, 7 months