Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix y2log path in popup messages #85

Merged
merged 14 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package/yast2-auth-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 30 11:51:52 UTC 2023 - Samuel Cabrero <[email protected]>

- Fix y2log path in popup messages (bsc#1207831)
- 4.4.1

-------------------------------------------------------------------
Tue Apr 20 13:51:55 UTC 2021 - Ladislav Slezák <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-auth-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Name: yast2-auth-server
Group: System/YaST
Summary: A tool for creating identity management server instances
Version: 4.4.0
Version: 4.4.1
Release: 0
License: GPL-2.0-or-later
Url: https://github.com/yast/yast-auth-server
Expand Down
2 changes: 1 addition & 1 deletion src/lib/authserver/dir/ds389.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.gen_setup_ini(fqdn, instance_name, suffix, dm_pass)
end

# exec_setup runs setup-ds.pl using input parameters file content.
# The output of setup script is written into file .y2log or /var/log/YaST/y2log
# The output of setup script is written into file .y2log or /var/log/YaST2/y2log
# Returns true only if setup was successful.
def self.exec_setup(content)
append_to_log('Beginning YAST auth server installation ...')
Expand Down
24 changes: 21 additions & 3 deletions src/lib/authserver/ui/new_dir_inst.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ def ok_handler
# Always remove the ini file
DS389.remove_setup_ini
if !ok
Popup.Error(_('Failed to set up new instance! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to set up new instance! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
Expand All @@ -129,7 +135,13 @@ def ok_handler
UI.ReplaceWidget(Id(:busy), Label(_('Configuring instance TLS ...')))
# Turn on TLS
if !DS389.install_tls_in_nss(instance_name, tls_ca, tls_p12)
Popup.Error(_('Failed to set up new instance! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to set up new instance! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
Expand All @@ -142,7 +154,13 @@ def ok_handler
end

UI.ReplaceWidget(Id(:busy), Empty())
Popup.Message(_('New instance has been set up! Log output may be found in /var/log/YaST/y2log'))
Popup.Message(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('New instance has been set up! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
finish_dialog(:next)
UI.ReplaceWidget(Id(:busy), Empty())
end
Expand Down
80 changes: 70 additions & 10 deletions src/lib/authserver/ui/new_krb_inst.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,28 +153,52 @@ def ok_handler
out, ok = ldap.create_person(kdc_dn_prefix, 'Kerberos KDC Connection', dir_suffix)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to create Kerberos KDC connection user! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to create Kerberos KDC connection user! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
out, ok = ldap.change_password(kdc_dn,kdc_pass)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to create Kerberos KDC connection user! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to create Kerberos KDC connection user! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
out, ok = ldap.create_person(admin_dn_prefix, 'Kerberos Administration Connection', dir_suffix)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to create Kerberos administration user! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to create Kerberos administration user! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
out, ok = ldap.change_password(admin_dn,admin_pass)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to create Kerberos KDC administration user! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to create Kerberos KDC administration user! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
Expand All @@ -198,14 +222,26 @@ def ok_handler
out, ok = MITKerberos.save_password_into_file(kdc_dn, kdc_pass, pass_file_path)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to create password file! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to create password file! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
out, ok = MITKerberos.save_password_into_file(admin_dn, admin_pass, pass_file_path)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to create password file! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to create password file! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
Expand All @@ -214,7 +250,13 @@ def ok_handler
out, ok = MITKerberos.init_dir(dir_addr, dm_dn, dm_pass, realm, container_dn, master_pass)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Kerberos initialisation failure! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Kerberos initialisation failure! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
Expand All @@ -223,14 +265,26 @@ def ok_handler
out, ok = ldap.aci_allow_modify(container_dn, 'kerberos-admin', admin_dn)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to modify directory permission! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to modify directory permission! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
out, ok = ldap.aci_allow_modify(container_dn, 'kerberos-kdc', kdc_dn)
MITKerberos.append_to_log('%s' % out)
if !ok
Popup.Error(_('Failed to modify directory permission! Log output may be found in /var/log/YaST/y2log'))
Popup.Error(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('Failed to modify directory permission! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
UI.ReplaceWidget(Id(:busy), Empty())
return
end
Expand All @@ -248,7 +302,13 @@ def ok_handler
end

UI.ReplaceWidget(Id(:busy), Empty())
Popup.Message(_('New instance has been set up! Log output may be found in /var/log/YaST/y2log'))
Popup.Message(
# TRANSLATORS: %{y2log_path} is replaced by the YaST2 logs path.
format(
_('New instance has been set up! Log output may be found in %{y2log_path}/y2log'),
y2log_path: Yast::Directory.logdir
)
)
finish_dialog(:next)
UI.ReplaceWidget(Id(:busy), Empty())
end
Expand Down