summaryrefslogtreecommitdiffstats
path: root/lib/python/apex/network_settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/python/apex/network_settings.py')
-rw-r--r--lib/python/apex/network_settings.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py
index 64065ca7..b04f141a 100644
--- a/lib/python/apex/network_settings.py
+++ b/lib/python/apex/network_settings.py
@@ -12,7 +12,7 @@ import logging
import ipaddress
from copy import copy
-
+from .common import utils
from . import ip_utils
from .common.constants import (
CONTROLLER,
@@ -338,11 +338,7 @@ class NetworkSettings(dict):
bash_str += flatten('dns_servers', self['dns_servers'], ' ')
bash_str += flatten('domain_name', self['dns-domain'], ' ')
bash_str += flatten('ntp_server', self['ntp_servers'][0], ' ')
- if path:
- with open(path, 'w') as file:
- file.write(bash_str)
- else:
- print(bash_str)
+ utils.write_str(bash_str, path)
def get_ip_addr_family(self,):
"""