Adds declaring disk device to use on overcloud nodes
[apex.git] / lib / python / apex / network_settings.py
index 64065ca..b04f141 100644 (file)
@@ -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,):
         """