|
|
d88f46 |
diff --git a/rel-eng/packages/subscription-manager b/rel-eng/packages/subscription-manager
|
|
|
d88f46 |
index 9f6984a..e58ffb0 100644
|
|
|
d88f46 |
--- a/rel-eng/packages/subscription-manager
|
|
|
d88f46 |
+++ b/rel-eng/packages/subscription-manager
|
|
|
d88f46 |
@@ -1 +1 @@
|
|
|
d88f46 |
-1.15.9-8 ./
|
|
|
d88f46 |
+1.15.9-9 ./
|
|
|
d88f46 |
diff --git a/src/subscription_manager/gui/registergui.py b/src/subscription_manager/gui/registergui.py
|
|
|
d88f46 |
index 3ba0fff..08168b2 100644
|
|
|
d88f46 |
--- a/src/subscription_manager/gui/registergui.py
|
|
|
d88f46 |
+++ b/src/subscription_manager/gui/registergui.py
|
|
|
d88f46 |
@@ -316,8 +316,7 @@ class RegisterWidget(widgets.SubmanBaseWidget):
|
|
|
d88f46 |
|
|
|
d88f46 |
# Unset backend from attempting to use basic auth
|
|
|
d88f46 |
if activation_keys:
|
|
|
d88f46 |
- self.async.cp_provider.set_user_pass()
|
|
|
d88f46 |
- self.async.update()
|
|
|
d88f46 |
+ self.async.set_user_pass()
|
|
|
d88f46 |
|
|
|
d88f46 |
def _on_details_label_txt_change(self, obj, value):
|
|
|
d88f46 |
"""Update the label under the progress bar on progress page."""
|
|
|
d88f46 |
@@ -509,42 +508,55 @@ class RegisterDialog(widgets.SubmanBaseWidget):
|
|
|
d88f46 |
self.connect_signals(callbacks)
|
|
|
d88f46 |
|
|
|
d88f46 |
self.reg_info = RegisterInfo()
|
|
|
d88f46 |
- # FIXME: Need better error handling in general, but it's kind of
|
|
|
d88f46 |
- # annoying to have to pass the top level widget all over the place
|
|
|
d88f46 |
- self.register_widget = RegisterWidget(backend, facts,
|
|
|
d88f46 |
- reg_info=self.reg_info,
|
|
|
d88f46 |
- parent_window=self.register_dialog)
|
|
|
d88f46 |
-
|
|
|
d88f46 |
- # Ensure that we start on the first page and that
|
|
|
d88f46 |
- # all widgets are cleared.
|
|
|
d88f46 |
- self.register_widget.initialize()
|
|
|
d88f46 |
|
|
|
d88f46 |
+ # RegisterWidget is a oect, but not a Gtk.Widget
|
|
|
d88f46 |
+ self.register_widget = self.create_register_widget(backend, facts, self.reg_info,
|
|
|
d88f46 |
+ self.register_dialog)
|
|
|
d88f46 |
+ # But RegisterWidget.register_widget is a Gtk.Widget, so add it to
|
|
|
d88f46 |
+ # out container
|
|
|
d88f46 |
self.register_dialog_main_vbox.pack_start(self.register_widget.register_widget,
|
|
|
d88f46 |
True, True, 0)
|
|
|
d88f46 |
|
|
|
d88f46 |
+ # reset/clear/setup
|
|
|
d88f46 |
+ self.register_widget.initialize()
|
|
|
d88f46 |
+
|
|
|
d88f46 |
self.register_button.connect('clicked', self._on_register_button_clicked)
|
|
|
d88f46 |
self.cancel_button.connect('clicked', self.cancel)
|
|
|
d88f46 |
|
|
|
d88f46 |
+ self.window = self.register_dialog
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ # FIXME: needed by firstboot
|
|
|
d88f46 |
+ self.password = None
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ def create_register_widget(self, backend, facts, reg_info, parent_window):
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ # FIXME: Need better error handling in general, but it's kind of
|
|
|
d88f46 |
+ # annoying to have to pass the top level widget all over the place
|
|
|
d88f46 |
+ register_widget = RegisterWidget(backend=backend,
|
|
|
d88f46 |
+ facts=facts,
|
|
|
d88f46 |
+ reg_info=reg_info,
|
|
|
d88f46 |
+ parent_window=parent_window)
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ # Ensure that we start on the first page and that
|
|
|
d88f46 |
+ # all widgets are cleared.
|
|
|
d88f46 |
+ register_widget.initialize()
|
|
|
d88f46 |
+
|
|
|
d88f46 |
# initial-setup will likely handle these itself
|
|
|
d88f46 |
- self.register_widget.connect('finished', self.cancel)
|
|
|
d88f46 |
- self.register_widget.connect('register-error', self.on_register_error)
|
|
|
d88f46 |
+ register_widget.connect('finished', self.cancel)
|
|
|
d88f46 |
+ register_widget.connect('register-error', self.on_register_error)
|
|
|
d88f46 |
|
|
|
d88f46 |
# update window title on register state changes
|
|
|
d88f46 |
- self.register_widget.info.connect('notify::register-state',
|
|
|
d88f46 |
- self._on_register_state_change)
|
|
|
d88f46 |
+ register_widget.info.connect('notify::register-state',
|
|
|
d88f46 |
+ self._on_register_state_change)
|
|
|
d88f46 |
|
|
|
d88f46 |
# update the 'next/register button on page change'
|
|
|
d88f46 |
- self.register_widget.connect('notify::register-button-label',
|
|
|
d88f46 |
- self._on_register_button_label_change)
|
|
|
d88f46 |
-
|
|
|
d88f46 |
- self.window = self.register_dialog
|
|
|
d88f46 |
+ register_widget.connect('notify::register-button-label',
|
|
|
d88f46 |
+ self._on_register_button_label_change)
|
|
|
d88f46 |
|
|
|
d88f46 |
- # FIXME: needed by firstboot
|
|
|
d88f46 |
- self.password = None
|
|
|
d88f46 |
+ return register_widget
|
|
|
d88f46 |
|
|
|
d88f46 |
def initialize(self):
|
|
|
d88f46 |
- self.register_widget.clear_screens()
|
|
|
d88f46 |
- # self.register_widget.initialize()
|
|
|
d88f46 |
+ self.register_widget.initialize()
|
|
|
d88f46 |
|
|
|
d88f46 |
def show(self):
|
|
|
d88f46 |
# initial-setup module skips this, since it results in a
|
|
|
d88f46 |
@@ -1436,7 +1448,7 @@ class AsyncBackend(object):
|
|
|
d88f46 |
def update(self):
|
|
|
d88f46 |
self.backend.update()
|
|
|
d88f46 |
|
|
|
d88f46 |
- def set_user_pass(self, username, password):
|
|
|
d88f46 |
+ def set_user_pass(self, username=None, password=None):
|
|
|
d88f46 |
self.backend.cp_provider.set_user_pass(username, password)
|
|
|
d88f46 |
self.backend.update()
|
|
|
d88f46 |
|
|
|
d88f46 |
diff --git a/src/subscription_manager/managercli.py b/src/subscription_manager/managercli.py
|
|
|
d88f46 |
index 3933c30..c23e0d8 100644
|
|
|
d88f46 |
--- a/src/subscription_manager/managercli.py
|
|
|
d88f46 |
+++ b/src/subscription_manager/managercli.py
|
|
|
d88f46 |
@@ -1917,7 +1917,7 @@ class ReposCommand(CliCommand):
|
|
|
d88f46 |
def _do_command(self):
|
|
|
d88f46 |
self._validate_options()
|
|
|
d88f46 |
rc = 0
|
|
|
d88f46 |
- if cfg.has_option('rhsm', 'manage_repos') and not int(cfg.get('rhsm', 'manage_repos')):
|
|
|
d88f46 |
+ if cfg.has_option('rhsm', 'manage_repos') and not cfg.get_int('rhsm', 'manage_repos'):
|
|
|
d88f46 |
print _("Repositories disabled by configuration.")
|
|
|
d88f46 |
return rc
|
|
|
d88f46 |
|
|
|
d88f46 |
diff --git a/src/subscription_manager/repolib.py b/src/subscription_manager/repolib.py
|
|
|
d88f46 |
index fdbcf80..f07dac6 100644
|
|
|
d88f46 |
--- a/src/subscription_manager/repolib.py
|
|
|
d88f46 |
+++ b/src/subscription_manager/repolib.py
|
|
|
d88f46 |
@@ -191,7 +191,7 @@ class RepoUpdateActionCommand(object):
|
|
|
d88f46 |
self.manage_repos = 1
|
|
|
d88f46 |
self.apply_overrides = apply_overrides
|
|
|
d88f46 |
if CFG.has_option('rhsm', 'manage_repos'):
|
|
|
d88f46 |
- self.manage_repos = int(CFG.get('rhsm', 'manage_repos'))
|
|
|
d88f46 |
+ self.manage_repos = CFG.get_int('rhsm', 'manage_repos')
|
|
|
d88f46 |
|
|
|
d88f46 |
self.release = None
|
|
|
d88f46 |
self.overrides = {}
|
|
|
d88f46 |
@@ -684,7 +684,7 @@ class RepoFile(ConfigParser):
|
|
|
d88f46 |
self.repos_dir = Path.abs(self.PATH)
|
|
|
d88f46 |
self.manage_repos = 1
|
|
|
d88f46 |
if CFG.has_option('rhsm', 'manage_repos'):
|
|
|
d88f46 |
- self.manage_repos = int(CFG.get('rhsm', 'manage_repos'))
|
|
|
d88f46 |
+ self.manage_repos = CFG.get_int('rhsm', 'manage_repos')
|
|
|
d88f46 |
# Simulate manage repos turned off if no yum.repos.d directory exists.
|
|
|
d88f46 |
# This indicates yum is not installed so clearly no need for us to
|
|
|
d88f46 |
# manage repos.
|
|
|
d88f46 |
diff --git a/subscription-manager.spec b/subscription-manager.spec
|
|
|
d88f46 |
index e6d4b1d..04b915a 100644
|
|
|
d88f46 |
--- a/subscription-manager.spec
|
|
|
d88f46 |
+++ b/subscription-manager.spec
|
|
|
d88f46 |
@@ -49,7 +49,7 @@
|
|
|
d88f46 |
|
|
|
d88f46 |
Name: subscription-manager
|
|
|
d88f46 |
Version: 1.15.9
|
|
|
d88f46 |
-Release: 8%{?dist}
|
|
|
d88f46 |
+Release: 9%{?dist}
|
|
|
d88f46 |
Summary: Tools and libraries for subscription and repository management
|
|
|
d88f46 |
Group: System Environment/Base
|
|
|
d88f46 |
License: GPLv2
|
|
|
d88f46 |
@@ -542,6 +542,14 @@ fi
|
|
|
d88f46 |
%endif
|
|
|
d88f46 |
|
|
|
d88f46 |
%changelog
|
|
|
d88f46 |
+* Thu Sep 10 2015 Chris Rog <crog@redhat.com> 1.15.9-9
|
|
|
d88f46 |
+- 1261572: Re-initialize() RegisterWidget on RegDialog show
|
|
|
d88f46 |
+ (alikins@redhat.com)
|
|
|
d88f46 |
+- 1254550: Fix activation key usage in gui. (alikins@redhat.com)
|
|
|
d88f46 |
+- 1251853: Manage repos config entry needs to allow blank value
|
|
|
d88f46 |
+ (wpoteat@redhat.com)
|
|
|
d88f46 |
+- Use Notebook 'page' prop notify signal for tests (alikins@redhat.com)
|
|
|
d88f46 |
+
|
|
|
d88f46 |
* Wed Sep 02 2015 Chris Rog <crog@redhat.com> 1.15.9-8
|
|
|
d88f46 |
- 884288: Better registergui for initial-setup (alikins@redhat.com)
|
|
|
d88f46 |
- Fix 'make gladelint' errors in repositories.glade (alikins@redhat.com)
|
|
|
d88f46 |
diff --git a/test/stubs.py b/test/stubs.py
|
|
|
d88f46 |
index 36c8888..a8cd338 100644
|
|
|
d88f46 |
--- a/test/stubs.py
|
|
|
d88f46 |
+++ b/test/stubs.py
|
|
|
d88f46 |
@@ -442,7 +442,7 @@ class StubUEP(object):
|
|
|
d88f46 |
def getCertificateSerials(self, consumer):
|
|
|
d88f46 |
return []
|
|
|
d88f46 |
|
|
|
d88f46 |
- def getCompliance(self, uuid):
|
|
|
d88f46 |
+ def getCompliance(self, uuid, on_data=None):
|
|
|
d88f46 |
return {}
|
|
|
d88f46 |
|
|
|
d88f46 |
def getEntitlementList(self, uuid):
|
|
|
d88f46 |
diff --git a/test/test_registrationgui.py b/test/test_registrationgui.py
|
|
|
d88f46 |
index 9374325..ad497af 100644
|
|
|
d88f46 |
--- a/test/test_registrationgui.py
|
|
|
d88f46 |
+++ b/test/test_registrationgui.py
|
|
|
d88f46 |
@@ -11,10 +11,14 @@ from subscription_manager.gui.registergui import RegisterWidget, \
|
|
|
d88f46 |
from subscription_manager.ga import GObject as ga_GObject
|
|
|
d88f46 |
from subscription_manager.ga import Gtk as ga_Gtk
|
|
|
d88f46 |
|
|
|
d88f46 |
+import sys
|
|
|
d88f46 |
+
|
|
|
d88f46 |
|
|
|
d88f46 |
class RegisterWidgetTests(SubManFixture):
|
|
|
d88f46 |
def setUp(self):
|
|
|
d88f46 |
super(RegisterWidgetTests, self).setUp()
|
|
|
d88f46 |
+ self.exc_infos = []
|
|
|
d88f46 |
+ self.excs = []
|
|
|
d88f46 |
self.backend = StubBackend()
|
|
|
d88f46 |
expected_facts = {'fact1': 'one',
|
|
|
d88f46 |
'fact2': 'two',
|
|
|
d88f46 |
@@ -33,43 +37,79 @@ class RegisterWidgetTests(SubManFixture):
|
|
|
d88f46 |
def test_show(self):
|
|
|
d88f46 |
self.rs.initialize()
|
|
|
d88f46 |
|
|
|
d88f46 |
- # FIXME: unit tests for gtk is a weird universe
|
|
|
d88f46 |
- def test_registration_error_returns_to_page(self):
|
|
|
d88f46 |
- self.rs.initialize()
|
|
|
d88f46 |
+ def page_notify_handler(self, obj, param):
|
|
|
d88f46 |
+ page_after = obj.get_current_page()
|
|
|
d88f46 |
+ # NOTE: these exceptions are not in the nost test context,
|
|
|
d88f46 |
+ # so they don't actually fail nose
|
|
|
d88f46 |
+ try:
|
|
|
d88f46 |
+ self.assertEquals(page_after, 0)
|
|
|
d88f46 |
+ except Exception:
|
|
|
d88f46 |
+ self.exc_infos.append(sys.exc_info())
|
|
|
d88f46 |
+ return
|
|
|
d88f46 |
|
|
|
d88f46 |
- self.correct_page = None
|
|
|
d88f46 |
+ self.correct_page = True
|
|
|
d88f46 |
+ self.gtk_quit()
|
|
|
d88f46 |
+ return False
|
|
|
d88f46 |
|
|
|
d88f46 |
- def error_handler(obj, msg, exc_info):
|
|
|
d88f46 |
- page_after = self.rs.register_notebook.get_current_page()
|
|
|
d88f46 |
+ def error_handler(self, obj, msg, exc_info):
|
|
|
d88f46 |
+ page_after = self.rs.register_notebook.get_current_page()
|
|
|
d88f46 |
|
|
|
d88f46 |
- # NOTE: these exceptions are not in the nost test context,
|
|
|
d88f46 |
- # so they don't actually fail nose
|
|
|
d88f46 |
+ # NOTE: these exceptions are not in the nost test context,
|
|
|
d88f46 |
+ # so they don't actually fail nose
|
|
|
d88f46 |
+ try:
|
|
|
d88f46 |
self.assertEquals(page_after, 0)
|
|
|
d88f46 |
- self.correct_page = True
|
|
|
d88f46 |
- self.quit()
|
|
|
d88f46 |
+ except Exception:
|
|
|
d88f46 |
+ self.exc_infos.append(sys.exc_info())
|
|
|
d88f46 |
+ return
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ self.correct_page = True
|
|
|
d88f46 |
+ self.gtk_quit()
|
|
|
d88f46 |
+ return False
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ def emit_proceed(self):
|
|
|
d88f46 |
+ self.rs.emit('proceed')
|
|
|
d88f46 |
+ return False
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ def emit_error(self):
|
|
|
d88f46 |
+ self.rs.emit('register-error', 'Some register error', None)
|
|
|
d88f46 |
+ return False
|
|
|
d88f46 |
|
|
|
d88f46 |
- def emit_proceed():
|
|
|
d88f46 |
- self.rs.emit('proceed')
|
|
|
d88f46 |
- return False
|
|
|
d88f46 |
+ # FIXME: unit tests for gtk is a weird universe
|
|
|
d88f46 |
+ def test_registration_error_returns_to_page(self):
|
|
|
d88f46 |
+ self.rs.initialize()
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ self.correct_page = None
|
|
|
d88f46 |
|
|
|
d88f46 |
- def emit_error():
|
|
|
d88f46 |
- self.rs.emit('register-error', 'Some register error', None)
|
|
|
d88f46 |
- return False
|
|
|
d88f46 |
+ self.rs.register_notebook.connect('notify::page', self.page_notify_handler)
|
|
|
d88f46 |
|
|
|
d88f46 |
- self.rs.connect('register-error', error_handler)
|
|
|
d88f46 |
+ self.rs.connect('register-error', self.error_handler)
|
|
|
d88f46 |
|
|
|
d88f46 |
- ga_GObject.timeout_add(250, self.quit)
|
|
|
d88f46 |
- ga_GObject.idle_add(emit_proceed)
|
|
|
d88f46 |
- ga_GObject.idle_add(emit_error)
|
|
|
d88f46 |
+ ga_GObject.timeout_add(3000, self.gtk_quit_on_fail)
|
|
|
d88f46 |
+ ga_GObject.idle_add(self.emit_proceed)
|
|
|
d88f46 |
+ ga_GObject.idle_add(self.emit_error)
|
|
|
d88f46 |
|
|
|
d88f46 |
# run till quit or timeout
|
|
|
d88f46 |
# if we get to the state we want we can call quit
|
|
|
d88f46 |
ga_Gtk.main()
|
|
|
d88f46 |
|
|
|
d88f46 |
- # verify class scope self.correct_page got set correct in error handler
|
|
|
d88f46 |
+ # If we saw any exceptions, raise them now so we fail nosetests
|
|
|
d88f46 |
+ for exc_info in self.exc_infos:
|
|
|
d88f46 |
+ raise exc_info[1], None, exc_info[2]
|
|
|
d88f46 |
+
|
|
|
d88f46 |
self.assertTrue(self.correct_page)
|
|
|
d88f46 |
|
|
|
d88f46 |
- def quit(self):
|
|
|
d88f46 |
+ # if we got the right answer, go ahead and end gtk.main()
|
|
|
d88f46 |
+ def gtk_quit(self):
|
|
|
d88f46 |
+ ga_Gtk.main_quit()
|
|
|
d88f46 |
+
|
|
|
d88f46 |
+ # End the main loop, but first add an exception to sys.exc_info so
|
|
|
d88f46 |
+ # the end of the tests can fail on it.
|
|
|
d88f46 |
+ def gtk_quit_on_fail(self):
|
|
|
d88f46 |
+ try:
|
|
|
d88f46 |
+ self.fail("registergui didn't get a signal before the timeout.")
|
|
|
d88f46 |
+ except Exception:
|
|
|
d88f46 |
+ self.exc_infos.append(sys.exc_info())
|
|
|
d88f46 |
+
|
|
|
d88f46 |
ga_Gtk.main_quit()
|
|
|
d88f46 |
|
|
|
d88f46 |
|