virt-manager/0003-oscontainer-ask-root-password-in-the-wizard.patch
Cédric Bosdonnat 2d98c3c1d3 Accepting request 558209 from home:cbosdonnat:branches:Virtualization
- Fix display and input of text in serial console (bsc#1070896)
  python3-fix-bytes-string-mess-in-serial-console.patch
- Fix virt-bootstrap UI integration (bsc#1063367)
  0001-Improve-container-image-url-example.patch
  0002-create-wizard-fix-alignment-in-os-container-page.patch
  0003-oscontainer-ask-root-password-in-the-wizard.patch
  0004-Harmonize-invisible_char-values.patch

OBS-URL: https://build.opensuse.org/request/show/558209
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=390
2017-12-18 15:54:02 +00:00

121 lines
6.8 KiB
Diff

From 7fb94b1bec19cb01243b6f50483a7ae4ba5b4b76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Thu, 14 Dec 2017 08:49:53 +0100
Subject: [PATCH 3/3] oscontainer: ask root password in the wizard
When creating a new root file system out of an downloaded image,
the root password is likely to be changed. Add a field for this
in the new guest wizard.
---
ui/create.ui | 36 ++++++++++++++++++++++++++++++++++++
virtManager/create.py | 14 ++++++++++++--
2 files changed, 48 insertions(+), 2 deletions(-)
Index: virt-manager-1.4.3/ui/create.ui
===================================================================
--- virt-manager-1.4.3.orig/ui/create.ui
+++ virt-manager-1.4.3/ui/create.ui
@@ -1901,6 +1901,42 @@ connections is not yet supported.&lt;/sm
<property name="position">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="install-oscontainer-rootpw-box">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Root password:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="install-oscontainer-rootpw">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">●</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>
Index: virt-manager-1.4.3/virtManager/create.py
===================================================================
--- virt-manager-1.4.3.orig/virtManager/create.py
+++ virt-manager-1.4.3/virtManager/create.py
@@ -465,6 +465,7 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-oscontainer-source-insecure").set_active(False)
self.widget("install-oscontainer-bootstrap").set_active(False)
self.widget("install-oscontainer-auth-options").set_expanded(False)
+ self.widget("install-oscontainer-rootpw").set_text("")
src_model = (self.widget("install-oscontainer-source-url-combo")
.get_model())
_populate_media_model(src_model, self.config.get_container_urls())
@@ -701,7 +702,8 @@ class vmmCreate(vmmGObjectUI):
"install-oscontainer-notsupport-conn": not is_local,
"install-oscontainer-notsupport": not vb_installed,
"install-oscontainer-bootstrap": vb_enabled,
- "install-oscontainer-source": vb_enabled
+ "install-oscontainer-source": vb_enabled,
+ "install-oscontainer-rootpw-box": vb_enabled
}
for w in oscontainer_widget_conf:
self.widget(w).set_visible(oscontainer_widget_conf[w])
@@ -1329,6 +1331,10 @@ class vmmCreate(vmmGObjectUI):
return self.widget("install-oscontainer-source-insecure").get_active()
+ def _get_config_oscontainer_root_password(self):
+ return self.widget("install-oscontainer-rootpw").get_text()
+
+
def _should_skip_disk_page(self):
return self._get_config_install_page() in [INSTALL_PAGE_IMPORT,
INSTALL_PAGE_CONTAINER_APP,
@@ -1732,6 +1738,7 @@ class vmmCreate(vmmGObjectUI):
def _container_source_toggle(self, ignore):
enable_src = self.widget("install-oscontainer-bootstrap").get_active()
self.widget("install-oscontainer-source").set_sensitive(enable_src)
+ self.widget("install-oscontainer-rootpw-box").set_sensitive(enable_src)
# Auto-generate a path if not specified
if enable_src and not self.widget("install-oscontainer-fs").get_text():
@@ -2577,7 +2584,8 @@ class vmmCreate(vmmGObjectUI):
'dest': self.widget("install-oscontainer-fs").get_text,
'user': self._get_config_oscontainer_source_username,
'passwd': self._get_config_oscontainer_source_password,
- 'insecure': self._get_config_oscontainer_isecure
+ 'insecure': self._get_config_oscontainer_isecure,
+ 'root_password': self._get_config_oscontainer_root_password,
}
for key, getter in list(bootstrap_arg_keys.items()):
bootstrap_args[key] = getter()
@@ -2733,6 +2741,8 @@ class vmmCreate(vmmGObjectUI):
if bootstrap_args['user'] and bootstrap_args['passwd']:
kwargs['username'] = bootstrap_args['user']
kwargs['password'] = bootstrap_args['passwd']
+ if bootstrap_args['root_password']:
+ kwargs['root_password'] = bootstrap_args['root_password']
logging.debug('Start container bootstrap')
try:
virtBootstrap.bootstrap(**kwargs)