diff options
Diffstat (limited to 'ipapython/platform/redhat.py')
-rw-r--r-- | ipapython/platform/redhat.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ipapython/platform/redhat.py b/ipapython/platform/redhat.py index 1de03556..389785c7 100644 --- a/ipapython/platform/redhat.py +++ b/ipapython/platform/redhat.py @@ -44,11 +44,15 @@ from ipalib import api # names are ipapython.services.wellknownservices # backup_and_replace_hostname -- platform-specific way to set hostname and # make it persistent over reboots +# restore_network_configuration -- platform-specific way of restoring network +# configuration (e.g. static hostname) # restore_context -- platform-sepcific way to restore security context, if # applicable # check_selinux_status -- platform-specific way to see if SELinux is enabled # and restorecon is installed. -__all__ = ['authconfig', 'service', 'knownservices', 'backup_and_replace_hostname', 'restore_context', 'check_selinux_status'] +__all__ = ['authconfig', 'service', 'knownservices', + 'backup_and_replace_hostname', 'restore_context', 'check_selinux_status', + 'restore_network_configuration'] class RedHatService(base.PlatformService): def __wait_for_open_ports(self, instance_name=""): @@ -225,6 +229,11 @@ def backup_and_replace_hostname(fstore, statestore, hostname): else: statestore.backup_state('network', 'hostname', old_hostname) +def restore_network_configuration(fstore, statestore): + filepath = '/etc/sysconfig/network' + if fstore.has_file(filepath): + fstore.restore_file(filepath) + def check_selinux_status(restorecon='/sbin/restorecon'): """ We don't have a specific package requirement for policycoreutils |