def on_profileActivateButton_clicked(self, button): # pylint: disable-msg=W0613 profile = self.get_active_profile().ProfileName generic_run_dialog( command="/usr/bin/system-config-network-cmd", argv=["system-config-network-cmd", "-a", "-p", profile], title=_("Switching Profiles"), label=_("Switching to profile %s") % profile, errlabel=_("Failed to switch to profile %s") % profile, dialog=self.dialog) # Re-read the device list self.devicelist = self.getProfDeviceList(refresh=True) self.activedevicelist = NetworkDevice().get() # Update the gui self.hydrate() self.oldprofile = None # forces a re-read of oldprofile self.hydrateProfiles() self.update_dialog()
def deactivate(self, dialog = None): command = '/sbin/ifdown' param = [command, self.IPsecId, "down"] try: (ret, msg) = generic_run_dialog(\ command, param, catchfd = (1, 2), title = _('IPsec deactivating...'), label = _('Deactivating IPsec connection %s, ' 'please wait...') % (self.IPsecId), errlabel = _('Cannot deactivate ' 'IPsec connection %s!\n') % (self.IPsecId), dialog = dialog) except RuntimeError, msg: ret = -1
def deactivate(self, dialog=None): command = '/sbin/ifdown' param = [command, self.DeviceId, "down"] try: (ret, msg) = generic_run_dialog( command, param, catchfd=(1, 2), title=_('Network device deactivating...'), label=_('Deactivating network device %s, ' 'please wait...') % (self.DeviceId), errlabel=_('Cannot deactivate ' 'network device %s!\n') % (self.DeviceId), dialog=dialog) except RuntimeError, msg: ret = -1