[Kimchi-devel] [PATCH V2 2/2] Add a warn about NM running in the system.
Aline Manera
alinefm at linux.vnet.ibm.com
Mon Apr 27 12:43:21 UTC 2015
On 20/04/2015 16:43, Jose Ricardo Ziviani wrote:
> - If NetworkManager is running when user is trying to create a bridge,
> it will warn about problems that could happen, asking the user to
> turn NM service off while dealing with bridge creation.
>
> Signed-off-by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
> ---
> ui/js/src/kimchi.network.js | 5 +++++
> ui/pages/i18n.json.tmpl | 1 +
> 2 files changed, 6 insertions(+)
>
> diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
> index 90fb62b..be140e8 100644
> --- a/ui/js/src/kimchi.network.js
> +++ b/ui/js/src/kimchi.network.js
> @@ -323,6 +323,11 @@ kimchi.setDefaultNetworkType = function(isInterfaceAvail) {
> kimchi.enableBridgeOptions(false);
> $("#networkBriDisabledLabel").show();
> } else {
> + kimchi.getCapabilities(function(result) {
> + if (result && result.nm_running) {
> + kimchi.message.warn(i18n['KCHNET6001W']);
> + }
> + });
The kimchi.getCapabilities() result is cached on UI. So we just need to
call it once (check on ui/js/src/kimchi.main.js)
And then you can see an use of the cached value in
ui/js/src/kimchi.host.js, ui/js/src/kimchi.repository_edit_main.js,
ui/js/src/kimchi.template_add_main.js, etc
> $("#bridgeOptions").slideDown(100);
> $("#networkVlanID").toggle(false);
> $("#labelNetworkVlanID").toggle(false);
> diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
> index a7f9daf..a6e3f5b 100644
> --- a/ui/pages/i18n.json.tmpl
> +++ b/ui/pages/i18n.json.tmpl
> @@ -153,6 +153,7 @@
> "KCHNET6002M": "$_("This action will interrupt network connectivity for any virtual machine that depend on this network.")",
> "KCHNET6003M": "$_("Create a network")",
> "KCHNET6004M": "$_("This 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?")",
> "KCHPOOL6002M": "$_("This storage pool is empty.")",
More information about the Kimchi-devel
mailing list