diff --git a/src/system-config-kdump.glade b/src/system-config-kdump.glade index 66a53dd..97a47f4 100644 --- a/src/system-config-kdump.glade +++ b/src/system-config-kdump.glade @@ -882,7 +882,7 @@ True False False - 3 + 4 2 6 6 @@ -966,6 +966,19 @@ + + + True + False + The NFS export is currently not mounted. It has to be mounted for kdump to work. + True + + + 2 + 3 + 4 + + False diff --git a/src/system-config-kdump.py b/src/system-config-kdump.py index ddb542e..e6487cc 100755 --- a/src/system-config-kdump.py +++ b/src/system-config-kdump.py @@ -437,6 +437,7 @@ class MainWindow: self.path_entry = builder.get_object("pathEntry") self.servername_entry = builder.get_object("servernameEntry") self.servername_label = builder.get_object("networkServerLabel") + self.nfs_hint_label = builder.get_object("nfsHintLabel") # tab 2 self.filter_page = builder.get_object("filteringPage") @@ -1164,6 +1165,7 @@ class MainWindow: elif current_page == self.expert_page: self.cmdline_changed(self.command_line_entry) self.collector_entry_changed(self.core_collector_entry) + self.update_nfs_hint_label() def update_usable_mem(self, spin_button, *args): """ @@ -1328,6 +1330,7 @@ class MainWindow: self.my_settings.target_type = TYPE_SSH self.servername_label.set_text(_("Server name:")) self.check_settings() + self.update_nfs_hint_label() def custom_kernel_changed(self, button): """ @@ -1733,6 +1736,7 @@ class MainWindow: """ self.my_settings.server_name = entry.get_text() self.check_settings() + self.update_nfs_hint_label() return False def set_filter_checkbuttons(self, level): @@ -1835,6 +1839,24 @@ class MainWindow: self.update_local_hint_label(self.my_settings.local_partition, self.location_entry.get_text()) self.check_settings() + @staticmethod + def nfs_mounts(): + with open('/proc/mounts', 'r') as fh: + lines = fh.read().splitlines() + + mounts = [] + for line in lines: + line = line.split() + + dev = line[0] + mntpoint = line[1] + fstype = line[2] + + if fstype == "nfs": + mounts.append(dev) + + return mounts + def update_local_hint_label(self, partition, path): """ Update local_hint_label text with set partition and path @@ -1846,6 +1868,13 @@ class MainWindow: self.local_hint_label.set_text( _("core will be in %s/%%DATE on %s") %(path, partition)) + def update_nfs_hint_label(self): + if (self.my_settings.target_type == TYPE_NFS + and self.my_settings.server_name not in self.nfs_mounts()): + self.nfs_hint_label.set_visible(True) + else: + self.nfs_hint_label.set_visible(False) + def changed_raw_device(self, raw_dev_box, *args): """ Called when you change raw device in combobox and will save active one into settings