Hello community,

here is the log from the commit of package yast2-rmt for openSUSE:Factory 
checked in at 2018-05-19 15:42:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-rmt (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-rmt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-rmt"

Sat May 19 15:42:57 2018 rev:5 rq:610306 version:1.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-rmt/yast2-rmt.changes      2018-04-27 
16:09:17.846345544 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-rmt.new/yast2-rmt.changes 2018-05-19 
15:43:02.937348524 +0200
@@ -1,0 +2,9 @@
+Fri May 18 08:58:01 UTC 2018 - [email protected]
+
+- version 1.0.0
+- Release for SLES15 (bsc#1093879) 
+- UI cleanups
+- Enable timers with rmt service start
+- Add final configuration summary 
+
+-------------------------------------------------------------------

Old:
----
  yast2-rmt-0.0.4.tar.bz2

New:
----
  yast2-rmt-1.0.0.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-rmt.spec ++++++
--- /var/tmp/diff_new_pack.xd4GjH/_old  2018-05-19 15:43:03.573325256 +0200
+++ /var/tmp/diff_new_pack.xd4GjH/_new  2018-05-19 15:43:03.573325256 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-rmt
-Version:        0.0.4
+Version:        1.0.0
 Release:        0
 BuildArch:      noarch
 

++++++ yast2-rmt-0.0.4.tar.bz2 -> yast2-rmt-1.0.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/package/yast2-rmt.changes 
new/yast2-rmt-1.0.0/package/yast2-rmt.changes
--- old/yast2-rmt-0.0.4/package/yast2-rmt.changes       2018-04-24 
11:54:43.422604842 +0200
+++ new/yast2-rmt-1.0.0/package/yast2-rmt.changes       2018-05-18 
13:57:35.000000000 +0200
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Fri May 18 08:58:01 UTC 2018 - [email protected]
+
+- version 1.0.0
+- UI cleanups
+- Enable timers with rmt service start
+- Add final configuration summary 
+
+-------------------------------------------------------------------
 Wed Apr 18 12:06:01 UTC 2018 - [email protected]
 
 - version 0.0.4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/package/yast2-rmt.spec 
new/yast2-rmt-1.0.0/package/yast2-rmt.spec
--- old/yast2-rmt-0.0.4/package/yast2-rmt.spec  2018-04-24 11:54:43.422604842 
+0200
+++ new/yast2-rmt-1.0.0/package/yast2-rmt.spec  2018-05-18 13:57:35.000000000 
+0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-rmt
-Version:        0.0.4
+Version:        1.0.0
 Release:        0
 BuildArch:      noarch
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/spec/rmt/wizard_final_page_spec.rb 
new/yast2-rmt-1.0.0/spec/rmt/wizard_final_page_spec.rb
--- old/yast2-rmt-0.0.4/spec/rmt/wizard_final_page_spec.rb      2018-04-16 
15:10:34.949032563 +0200
+++ new/yast2-rmt-1.0.0/spec/rmt/wizard_final_page_spec.rb      2018-05-18 
13:57:35.000000000 +0200
@@ -23,7 +23,19 @@
 describe RMT::WizardFinalPage do
   subject(:final_page) { described_class.new(config) }
 
-  let(:config) { {} }
+  let(:config) do
+    {
+      'scc' => {
+        'username' => 'UC666'
+      },
+      'database' => {
+        'username' => 'user_mcuserface',
+        'password' => 'test',
+        'host' => 'localhost',
+        'database' => 'rmt'
+      }
+    }
+  end
 
   describe '#next_handler' do
     it 'finishes when next button is pressed' do
@@ -54,25 +66,10 @@
   end
 
   describe '#run' do
-    context 'when restarting the service succeeds' do
-      it 'renders content and enters the event loop' do
-        expect(Yast::Service).to receive(:Enable).with('rmt').and_return(true)
-        expect(Yast::Service).to receive(:Restart).with('rmt').and_return(true)
-        expect(final_page).to receive(:render_content)
-        expect(final_page).to receive(:event_loop)
-        final_page.run
-      end
-    end
-
-    context 'when restarting the service fails' do
-      it 'displays the error, renders content and enters the event loop' do
-        expect(Yast::Service).to receive(:Enable).with('rmt').and_return(true)
-        expect(Yast::Service).to 
receive(:Restart).with('rmt').and_return(false)
-        expect(Yast::Report).to receive(:Error).with("Failed to enable and 
restart service 'rmt'")
-        expect(final_page).to receive(:render_content)
-        expect(final_page).to receive(:event_loop)
-        final_page.run
-      end
+    it 'restarts rmt-server service and enters event loop' do
+      expect(final_page).to receive(:render_content)
+      expect(final_page).to receive(:event_loop)
+      final_page.run
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-rmt-0.0.4/spec/rmt/wizard_maria_db_page_spec.rb 
new/yast2-rmt-1.0.0/spec/rmt/wizard_maria_db_page_spec.rb
--- old/yast2-rmt-0.0.4/spec/rmt/wizard_maria_db_page_spec.rb   2018-04-16 
15:10:34.949032563 +0200
+++ new/yast2-rmt-1.0.0/spec/rmt/wizard_maria_db_page_spec.rb   2018-05-18 
13:57:35.000000000 +0200
@@ -30,7 +30,7 @@
       'database' => {
         'username' => 'user_mcuserface',
         'password' => 'test',
-        'hostname' => 'localhost',
+        'host' => 'localhost',
         'database' => 'rmt'
       }
     }
@@ -110,7 +110,7 @@
       it 'if current root password is empty, reports an error if setting new 
password failed' do
         expect(new_password_dialog_double).to 
receive(:run).and_return(password)
         expect(new_password_dialog_double).to 
receive(:set_root_password).and_return(false)
-        expect(Yast::Report).to receive(:Error).with('Setting new root 
password failed')
+        expect(Yast::Report).to receive(:Error).with('Setting new database 
root password failed')
         expect(mariadb_page).not_to receive(:finish_dialog)
         mariadb_page.next_handler
       end
@@ -134,7 +134,7 @@
 
       it 'shows error message and continues if no password was entered' do
         expect(current_password_dialog_double).to receive(:run).and_return(nil)
-        expect(Yast::Report).to receive(:Error).with('Root password not 
provided, skipping database setup.')
+        expect(Yast::Report).to receive(:Error).with('Database root password 
not provided, skipping database setup.')
         expect(RMT::Utils).to receive(:write_config_file).with(config)
         expect(mariadb_page).to receive(:finish_dialog).with(:next)
         mariadb_page.next_handler
@@ -170,13 +170,14 @@
     # rubocop:enable RSpec/VerifiedDoubles
 
     before do
+      expect(Yast::UI).to receive(:OpenDialog)
       expect(Yast::SystemdService).to 
receive(:find!).with('mysql').and_return(service_double)
       expect(service_double).to receive(:running?).and_return(false)
     end
 
     it "raises an error when mysql can't be started" do
       expect(service_double).to receive(:start).and_return(false)
-      expect(Yast::Report).to receive(:Error).with('Cannot start mysql 
service.')
+      expect(Yast::Report).to receive(:Error).with('Cannot start database 
service.')
       expect(mariadb_page.start_database).to be(false)
     end
 
@@ -218,7 +219,7 @@
           ['echo', 'select 1;'],
           [
             'mysql', '-u', config['database']['username'], 
"-p#{config['database']['password']}",
-            '-D', config['database']['database'], '-h', 
config['database']['hostname']
+            '-D', config['database']['database'], '-h', 
config['database']['host']
           ]
         ).and_raise(Cheetah::ExecutionFailed.new('command', 255, '', 
'Something went wrong'))
         expect(mariadb_page.check_db_credentials).to be(false)
@@ -226,12 +227,12 @@
     end
 
     context 'when the required configuration keys are present and are valid' do
-      it 'returns false' do
+      it 'returns true' do
         expect(RMT::Execute).to receive(:on_target!).with(
           ['echo', 'select 1;'],
           [
             'mysql', '-u', config['database']['username'], 
"-p#{config['database']['password']}",
-            '-D', config['database']['database'], '-h', 
config['database']['hostname']
+            '-D', config['database']['database'], '-h', 
config['database']['host']
           ]
         )
         expect(mariadb_page.check_db_credentials).to be(true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-rmt-0.0.4/spec/rmt/wizard_rmt_service_page_spec.rb 
new/yast2-rmt-1.0.0/spec/rmt/wizard_rmt_service_page_spec.rb
--- old/yast2-rmt-0.0.4/spec/rmt/wizard_rmt_service_page_spec.rb        
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-rmt-1.0.0/spec/rmt/wizard_rmt_service_page_spec.rb        
2018-05-18 13:57:35.000000000 +0200
@@ -0,0 +1,112 @@
+# Copyright (c) 2018 SUSE LLC.
+#  All Rights Reserved.
+
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of version 2 or 3 of the GNU General
+#  Public License as published by the Free Software Foundation.
+
+#  This program 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 General Public License for more details.
+
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, contact SUSE LLC.
+
+#  To contact SUSE about this file by physical or electronic mail,
+#  you may find current contact information at www.suse.com
+
+require 'rmt/wizard_rmt_service_page'
+
+Yast.import 'Wizard'
+
+describe RMT::WizardRMTServicePage do
+  subject(:service_page) { described_class.new(config) }
+
+  let(:config) do
+    {
+      'scc' => {
+        'username' => 'UC666'
+      },
+      'database' => {
+        'username' => 'user_mcuserface',
+        'password' => 'test',
+        'host' => 'localhost',
+        'database' => 'rmt'
+      }
+    }
+  end
+
+  describe '#next_handler' do
+    it 'finishes when next button is pressed' do
+      expect(service_page).to receive(:finish_dialog).with(:next)
+      service_page.next_handler
+    end
+  end
+
+  describe '#abort_handler' do
+    it 'finishes when abort button is pressed' do
+      expect(service_page).to receive(:finish_dialog).with(:abort)
+      service_page.abort_handler
+    end
+  end
+
+  describe '#back_handler' do
+    it 'finishes when back button is pressed' do
+      expect(service_page).to receive(:finish_dialog).with(:back)
+      service_page.back_handler
+    end
+  end
+
+  describe '#render_content' do
+    it 'renders UI elements' do
+      expect(Yast::Wizard).to receive(:SetContents)
+      service_page.render_content
+    end
+  end
+
+  describe '#run' do
+    context 'when service restart failed' do
+      it 'shows an error and continues' do
+        expect(service_page).to receive(:render_content)
+        expect(service_page).to receive(:rmt_service_start).and_return(false)
+        expect(Yast::Report).to receive(:Error).with("Failed to enable and 
restart service 'rmt-server'")
+        expect(Yast::Popup).to receive(:Feedback).and_call_original
+        expect(service_page).to receive(:event_loop)
+        service_page.run
+      end
+    end
+
+    context 'when service restart succeeded' do
+      it 'restarts rmt service and enters event loop' do
+        expect(service_page).to receive(:render_content)
+        expect(service_page).to receive(:rmt_service_start).and_return(true)
+        expect(Yast::Popup).to receive(:Feedback).and_call_original
+        expect(service_page).to receive(:event_loop)
+        service_page.run
+      end
+    end
+  end
+
+  describe '#rmt_service_start' do
+    context 'when restarting the service succeeds' do
+      it 'shows confirmation' do
+        expect(Yast::Service).to 
receive(:Enable).with('rmt-server').and_return(true)
+        expect(Yast::Service).to 
receive(:Restart).with('rmt-server').and_return(true)
+        %w[rmt-server-sync.timer rmt-server-mirror.timer].each do |unit|
+          expect(RMT::Execute).to receive(:on_target!).with('systemctl', 
'enable', unit).and_return(true)
+          expect(RMT::Execute).to receive(:on_target!).with('systemctl', 
'start', unit).and_return(true)
+        end
+        service_page.rmt_service_start
+      end
+    end
+
+    context 'when restarting the service fails' do
+      it 'displays error' do
+        expect(Yast::Service).to 
receive(:Enable).with('rmt-server').and_return(true)
+        expect(Yast::Service).to 
receive(:Restart).with('rmt-server').and_return(false)
+        expect(service_page.rmt_service_start).to be false
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/spec/rmt/wizard_scc_page_spec.rb 
new/yast2-rmt-1.0.0/spec/rmt/wizard_scc_page_spec.rb
--- old/yast2-rmt-0.0.4/spec/rmt/wizard_scc_page_spec.rb        2018-03-05 
17:04:38.523657953 +0100
+++ new/yast2-rmt-1.0.0/spec/rmt/wizard_scc_page_spec.rb        2018-05-18 
13:57:35.000000000 +0200
@@ -74,6 +74,7 @@
       it 'goes to the next page' do
         expect(scc_page).to receive(:scc_credentials_valid?).and_return(true)
         expect(Yast::Popup).not_to receive(:AnyQuestion)
+        expect(RMT::Utils).to receive(:write_config_file).with(config)
         expect(scc_page).to receive(:finish_dialog).with(:next)
         scc_page.next_handler
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/spec/rmt/wizard_spec.rb 
new/yast2-rmt-1.0.0/spec/rmt/wizard_spec.rb
--- old/yast2-rmt-0.0.4/spec/rmt/wizard_spec.rb 2018-04-16 15:10:34.949032563 
+0200
+++ new/yast2-rmt-1.0.0/spec/rmt/wizard_spec.rb 2018-05-18 13:57:35.000000000 
+0200
@@ -28,6 +28,7 @@
   let(:config) { { foo: 'bar' } }
   let(:scc_page_double) { instance_double(RMT::WizardSCCPage) }
   let(:db_page_double) { instance_double(RMT::WizardMariaDBPage) }
+  let(:service_page_double) { instance_double(RMT::WizardRMTServicePage) }
   let(:ssl_page_double) { instance_double(RMT::WizardSSLPage) }
   let(:final_page_double) { instance_double(RMT::WizardFinalPage) }
 
@@ -44,6 +45,9 @@
     expect(RMT::WizardMariaDBPage).to receive(:new).and_return(db_page_double)
     expect(db_page_double).to receive(:run).and_return(:next)
 
+    expect(RMT::WizardRMTServicePage).to 
receive(:new).and_return(service_page_double)
+    expect(service_page_double).to receive(:run).and_return(:next)
+
     expect(RMT::WizardSSLPage).to receive(:new).and_return(ssl_page_double)
     expect(ssl_page_double).to receive(:run).and_return(:next)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-rmt-0.0.4/src/lib/rmt/ssl/certificate_generator.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/ssl/certificate_generator.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/ssl/certificate_generator.rb        
2018-04-24 11:54:43.426604857 +0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/ssl/certificate_generator.rb        
2018-05-18 13:57:35.000000000 +0200
@@ -59,6 +59,9 @@
   end
 
   def server_cert_present?
+    # NB this doesn't check the second file if the first one exists
+    # An improvement would be to look for the absence of any ssl configuration 
and proceed in that case,
+    # but leave ssl alone if any configuration (hand-edited or incomplete) is 
found
     %i[server_private_key server_certificate].each do |file_type|
       return true if File.exist?(@ssl_paths[file_type]) && 
!File.zero?(@ssl_paths[file_type])
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/src/lib/rmt/utils.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/utils.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/utils.rb    2018-04-16 15:10:34.949032563 
+0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/utils.rb    2018-05-18 13:57:35.000000000 
+0200
@@ -17,6 +17,7 @@
 #  you may find current contact information at www.suse.com
 
 require 'yaml'
+require 'shellwords'
 
 Yast.import 'Report'
 
@@ -32,10 +33,10 @@
       'password' => ''
     },
     'database' => {
+      'host' => 'localhost',
       'database' => 'rmt',
       'username' => 'rmt',
-      'password' => '',
-      'hostname' => 'localhost'
+      'password' => ''
     }
   }.freeze
 
@@ -62,7 +63,7 @@
 
     # Runs a command and returns the exit code
     def run_command(command, *params)
-      params = params.map { |p| Yast::String.Quote(p) }
+      params = params.map { |p| Shellwords.escape(p) }
 
       Yast::SCR.Execute(
         Yast.path('.target.bash'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/src/lib/rmt/wizard.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/wizard.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/wizard.rb   2018-04-16 15:10:34.949032563 
+0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/wizard.rb   2018-05-18 13:57:35.000000000 
+0200
@@ -20,6 +20,7 @@
 require 'rmt/wizard_scc_page'
 require 'rmt/wizard_maria_db_page'
 require 'rmt/wizard_ssl_page'
+require 'rmt/wizard_rmt_service_page'
 require 'rmt/wizard_final_page'
 
 module RMT
@@ -49,6 +50,7 @@
       'step1' => -> { RMT::WizardSCCPage.new(@config).run },
       'step2' => -> { RMT::WizardMariaDBPage.new(@config).run },
       'step3' => -> { RMT::WizardSSLPage.new(@config).run },
+      'step4' => -> { RMT::WizardRMTServicePage.new(@config).run },
       'finish' => -> { RMT::WizardFinalPage.new(@config).run }
     }
 
@@ -56,7 +58,8 @@
       'ws_start' => 'step1',
       'step1'   => { abort: :abort, next: 'step2' },
       'step2'   => { abort: :abort, next: 'step3' },
-      'step3'   => { abort: :abort, next: 'finish' },
+      'step3'   => { abort: :abort, next: 'step4' },
+      'step4'   => { abort: :abort, next: 'finish' },
       'finish'  => { abort: :abort, next: :next }
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/src/lib/rmt/wizard_final_page.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/wizard_final_page.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/wizard_final_page.rb        2018-04-16 
15:10:34.949032563 +0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/wizard_final_page.rb        2018-05-18 
13:57:35.000000000 +0200
@@ -17,6 +17,8 @@
 #  you may find current contact information at www.suse.com
 
 require 'ui/event_dispatcher'
+require 'rmt/ssl/certificate_generator'
+require 'rmt/utils'
 
 module RMT; end
 
@@ -34,21 +36,38 @@
   def render_content
     Wizard.SetNextButton(:next, Label.FinishButton)
 
-    contents =
-      HBox(
-        HSpacing(1),
+    contents = HBox(
+      HStretch(),
+      VBox(
+        Left(Heading(_('Configuration Summary'))),
         VBox(
           VSpacing(1),
-          Label(_('RMT setup is now complete.')),
-          VSpacing(1)
-        ),
-        HSpacing(1)
-      )
+          Left(Heading(_('SCC Organization:'))),
+          Left(Label(@config['scc']['username'])),
+          VSpacing(1),
+          Left(Heading(_('RMT config file path:'))),
+          Left(Label(RMT::Utils::CONFIG_FILENAME.to_s)),
+          VSpacing(1),
+          Left(Heading(_('SSL certificate path:'))),
+          Left(Label(RMT::SSL::CertificateGenerator::RMT_SSL_DIR.to_s)),
+          VSpacing(1),
+          Left(Heading(_('Database credentials:'))),
+          Left(HBox(HSpacing(1),
+                    VBox(HBox(Label(_('Username:')), 
Label(@config['database']['username'])),
+                         HBox(Label(_('Password:')), 
Label(@config['database']['password']))))),
+          VSpacing(1),
+          Left(Label(_('Please ensure that any firewall is configured'))),
+          Left(Label(_('to allow access to RMT (default ports 80 and 443)')))
+        )
+      ),
+      HStretch()
+    )
 
     Wizard.SetContents(
-      _('RMT configuration'),
+      _('RMT configuration summary'),
       contents,
-      _('<p>RMT setup is now complete.</p>'),
+      _('<p>This is a list of all RMT configuration performed by this 
wizard.</p>'\
+        '<p>Please check for anything that is incorrect.</p>'),
       true,
       true
     )
@@ -67,7 +86,6 @@
   end
 
   def run
-    Yast::Report.Error(_("Failed to enable and restart service 'rmt'")) unless 
(Yast::Service.Enable('rmt') && Yast::Service.Restart('rmt'))
     render_content
     event_loop
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/src/lib/rmt/wizard_maria_db_page.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/wizard_maria_db_page.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/wizard_maria_db_page.rb     2018-04-16 
15:10:34.949032563 +0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/wizard_maria_db_page.rb     2018-05-18 
13:57:35.000000000 +0200
@@ -52,7 +52,7 @@
 
     Wizard.SetNextButton(:next, Label.NextButton)
     Wizard.SetContents(
-      _('RMT configuration step 2/3'),
+      _('RMT configuration step 2/4'),
       contents,
       _('<p>This step of the wizard performs the necessary database 
setup.</p>'),
       true,
@@ -81,8 +81,8 @@
       dialog = RMT::MariaDB::NewRootPasswordDialog.new
       new_root_password = dialog.run
 
-      if !new_root_password || new_root_password.empty? || 
!dialog.set_root_password(new_root_password, @config['database']['hostname'])
-        Report.Error(_('Setting new root password failed'))
+      if !new_root_password || new_root_password.empty? || 
!dialog.set_root_password(new_root_password, @config['database']['host'])
+        Report.Error(_('Setting new database root password failed'))
         return
       end
 
@@ -95,7 +95,7 @@
     if @root_password
       create_database_and_user
     else
-      Report.Error(_('Root password not provided, skipping database setup.'))
+      Report.Error(_('Database root password not provided, skipping database 
setup.'))
     end
 
     RMT::Utils.write_config_file(@config)
@@ -112,7 +112,7 @@
   end
 
   def check_db_credentials
-    %w[username password database hostname].each do |key|
+    %w[username password database host].each do |key|
       return false if (!@config['database'][key] || 
@config['database'][key].empty?)
     end
 
@@ -120,7 +120,7 @@
       ['echo', 'select 1;'],
       [
         'mysql', '-u', @config['database']['username'], 
"-p#{@config['database']['password']}",
-        '-D', @config['database']['database'], '-h', 
@config['database']['hostname']
+        '-D', @config['database']['database'], '-h', 
@config['database']['host']
       ]
     )
     true
@@ -131,19 +131,32 @@
   def root_password_empty?
     RMT::Utils.run_command(
       "echo 'show databases;' | mysql -u root -h %1 2>/dev/null",
-      @config['database']['hostname']
+      @config['database']['host']
     ) == 0
   end
 
   def start_database
+    UI.OpenDialog(
+      HBox(
+        HSpacing(5),
+        VBox(
+          VSpacing(5),
+          Left(Label(_('Starting database service...'))),
+          VSpacing(5)
+        ),
+        HSpacing(5)
+      )
+    )
     service = Yast::SystemdService.find!('mysql')
     is_running = service.running? ? true : service.start
 
     unless is_running
-      Report.Error(_('Cannot start mysql service.'))
+      Report.Error(_('Cannot start database service.'))
       return false
     end
 
+    UI.CloseDialog
+
     true
   end
 
@@ -151,7 +164,7 @@
     ret = RMT::Utils.run_command(
       "echo 'create database if not exists %1 character set = \"utf8\"' | 
mysql -u root -h %2 -p%3 2>/dev/null",
       @config['database']['database'],
-      @config['database']['hostname'],
+      @config['database']['host'],
       @root_password
     )
 
@@ -165,9 +178,9 @@
         "echo 'grant all on %1.* to \"%2\"\@%3 identified by \"%4\"' | mysql 
-u root -h %5 -p%6 >/dev/null",
         @config['database']['database'],
         @config['database']['username'],
-        @config['database']['hostname'],
+        @config['database']['host'],
         @config['database']['password'],
-        @config['database']['hostname'],
+        @config['database']['host'],
         @root_password
       )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-rmt-0.0.4/src/lib/rmt/wizard_rmt_service_page.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/wizard_rmt_service_page.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/wizard_rmt_service_page.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-rmt-1.0.0/src/lib/rmt/wizard_rmt_service_page.rb  2018-05-18 
13:57:35.000000000 +0200
@@ -0,0 +1,97 @@
+# Copyright (c) 2018 SUSE LLC.
+#  All Rights Reserved.
+
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of version 2 or 3 of the GNU General
+#  Public License as published by the Free Software Foundation.
+
+#  This program 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 General Public License for more details.
+
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, contact SUSE LLC.
+
+#  To contact SUSE about this file by physical or electronic mail,
+#  you may find current contact information at www.suse.com
+
+require 'ui/event_dispatcher'
+require 'rmt/utils'
+
+module RMT; end
+
+class RMT::WizardRMTServicePage < Yast::Client
+  include ::UI::EventDispatcher
+
+  Yast.import 'Service'
+
+  def initialize(config)
+    textdomain 'rmt'
+    @config = config
+  end
+
+  def render_content
+    Wizard.SetNextButton(:next, Label.NextButton)
+
+    contents = Frame(
+      _('RMT Service Status'),
+      HBox(
+        HSpacing(1),
+        VBox(
+          HSquash(
+            Label(Id(:service_status), 'Service \'rmt-server\' started, sync 
and mirroring systemd timers active.')
+          )
+        )
+      )
+    )
+
+    Wizard.SetContents(
+      _('RMT configuration step 4/4'),
+      contents,
+      _('<p>Starting the necessary services for RMT.</p>'),
+      true,
+      true
+    )
+  end
+
+  def next_handler
+    finish_dialog(:next)
+  end
+
+  def abort_handler
+    finish_dialog(:abort)
+  end
+
+  def back_handler
+    finish_dialog(:back)
+  end
+
+  def run
+    render_content
+    ok = false
+    Yast::Popup.Feedback(_('Starting services'), _('Starting RMT server, sync, 
and mirror timers...')) do
+      ok = rmt_service_start
+    end
+    unless ok
+      UI.ChangeWidget(Id(:service_status), :Value, 'Could not start 
\'rmt-server\' service.')
+      Yast::Report.Error(_("Failed to enable and restart service 
'rmt-server'"))
+    end
+    event_loop
+  end
+
+  def rmt_service_start
+    if Yast::Service.Enable('rmt-server') && 
Yast::Service.Restart('rmt-server')
+      rmt_enable_timers
+      return true
+    end
+    false
+  end
+
+  def rmt_enable_timers
+    %w[rmt-server-sync.timer rmt-server-mirror.timer].each do |timer|
+      RMT::Execute.on_target!('systemctl', 'enable', timer)
+      RMT::Execute.on_target!('systemctl', 'start', timer)
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/src/lib/rmt/wizard_scc_page.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/wizard_scc_page.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/wizard_scc_page.rb  2018-04-16 
15:10:34.949032563 +0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/wizard_scc_page.rb  2018-05-18 
13:57:35.000000000 +0200
@@ -54,7 +54,7 @@
     )
 
     Wizard.SetContents(
-      _('RMT configuration step 1/3'),
+      _('RMT configuration step 1/4'),
       contents,
       _("<p>Organization credentials can be found on Organization page at <a 
href='https://scc.suse.com/'>SUSE Customer Center</a>.</p>"),
       true,
@@ -83,6 +83,7 @@
       :focus_no
     )
 
+    RMT::Utils.write_config_file(@config)
     finish_dialog(:next)
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-rmt-0.0.4/src/lib/rmt/wizard_ssl_page.rb 
new/yast2-rmt-1.0.0/src/lib/rmt/wizard_ssl_page.rb
--- old/yast2-rmt-0.0.4/src/lib/rmt/wizard_ssl_page.rb  2018-04-24 
11:54:43.450604946 +0200
+++ new/yast2-rmt-1.0.0/src/lib/rmt/wizard_ssl_page.rb  2018-05-18 
13:57:35.000000000 +0200
@@ -66,7 +66,7 @@
     )
 
     Wizard.SetContents(
-      _('RMT configuration step 3/3'),
+      _('RMT configuration step 3/4'),
       contents,
       _('<p>This step of the wizard generates the required SSL 
certificates.</p>'),
       true,


Reply via email to