diff options
author | Frederic Lepied <frederic.lepied@enovance.com> | 2015-02-05 22:17:42 +0100 |
---|---|---|
committer | Frederic Lepied <frederic.lepied@redhat.com> | 2015-08-02 18:19:37 +0200 |
commit | 103b87aa82cfd298b664fe1314e987bd953ec20d (patch) | |
tree | e5691490fff33868291a6e8de946b8b8ac427ffe /os_net_config/impl_ifcfg.py | |
parent | cb578ed9b94ff9a34b41d91ada94e3375436b60c (diff) |
Allow to specify the root directory of the filesystem
Change-Id: Ice1b8d17804cf7a0aafd308945a5e960fe927bbc
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r-- | os_net_config/impl_ifcfg.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 0fe8cc5..99273bc 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2014 Red Hat, Inc. +# Copyright 2014-2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain @@ -45,8 +45,8 @@ def cleanup_pattern(): class IfcfgNetConfig(os_net_config.NetConfig): """Configure network interfaces using the ifcfg format.""" - def __init__(self, noop=False): - super(IfcfgNetConfig, self).__init__(noop) + def __init__(self, noop=False, root_dir=''): + super(IfcfgNetConfig, self).__init__(noop, root_dir) self.interface_data = {} self.route_data = {} self.bridge_data = {} @@ -250,8 +250,8 @@ class IfcfgNetConfig(os_net_config.NetConfig): for interface_name, iface_data in self.interface_data.iteritems(): route_data = self.route_data.get(interface_name, '') - interface_path = ifcfg_config_path(interface_name) - route_path = route_config_path(interface_name) + interface_path = self.root_dir + ifcfg_config_path(interface_name) + route_path = self.root_dir + route_config_path(interface_name) all_file_names.append(interface_path) all_file_names.append(route_path) if (utils.diff(interface_path, iface_data) or @@ -265,8 +265,8 @@ class IfcfgNetConfig(os_net_config.NetConfig): for bridge_name, bridge_data in self.bridge_data.iteritems(): route_data = self.route_data.get(bridge_name, '') - bridge_path = bridge_config_path(bridge_name) - bridge_route_path = route_config_path(bridge_name) + bridge_path = self.root_dir + bridge_config_path(bridge_name) + bridge_route_path = self.root_dir + route_config_path(bridge_name) all_file_names.append(bridge_path) all_file_names.append(bridge_route_path) if (utils.diff(bridge_path, bridge_data) or |