Gabriel-Adrian Samfira 6 лет назад
Родитель
Сommit
a1cb3adfa5
2 измененных файлов с 8 добавлено и 10 удалено
  1. 4 3
      coriolis/osmorphing/debian.py
  2. 4 7
      coriolis/utils.py

+ 4 - 3
coriolis/osmorphing/debian.py

@@ -19,6 +19,7 @@ auto %(device_name)s
 iface %(device_name)s inet dhcp
 """
 
+
 class BaseDebianMorphingTools(base.BaseLinuxOSMorphingTools):
     def _check_os(self):
         lsb_release_path = "etc/lsb-release"
@@ -61,7 +62,7 @@ class BaseDebianMorphingTools(base.BaseLinuxOSMorphingTools):
         fp = StringIO()
         fp.write(LO_NIC_TPL)
         fp.write("\n\n")
-        for idx,_ in enumerate(nics_info):
+        for idx, _ in enumerate(nics_info):
             dev_name = "eth%d" % idx
             cfg = INTERFACES_NIC_TPL % {
                 "device_name": dev_name,
@@ -73,7 +74,7 @@ class BaseDebianMorphingTools(base.BaseLinuxOSMorphingTools):
 
     def _compose_netplan_cfg(self, nics_info):
         cfg = {
-            "network":{
+            "network": {
                 "version": 2,
                 "ethernets": {
                     "lo": {
@@ -85,7 +86,7 @@ class BaseDebianMorphingTools(base.BaseLinuxOSMorphingTools):
                 }
             }
         }
-        for idx,_ in enumerate(nics_info):
+        for idx, _ in enumerate(nics_info):
             cfg["network"]["ethernets"]["eth%d" % idx] = {
                 "dhcp4": True,
                 "dhcp6": True,

+ 4 - 7
coriolis/utils.py

@@ -609,8 +609,8 @@ def create_service(ssh, cmdline, svcname, run_as=None, start=True):
     else:
         raise exception.CoriolisException(
             "could not determine init system")
-        
-        
+
+
 class Grub2ConfigEditor(object):
     """This class edits GRUB2 configs, normally found in
     /etc/default/grub. This class tries to preserve commented
@@ -715,7 +715,6 @@ class Grub2ConfigEditor(object):
         else:
             raise ValueError("unknown option type: %s" % opt_type)
 
-
     def set_option(self, option, value):
         """Replaces the value of an option completely
         """
@@ -750,12 +749,12 @@ class Grub2ConfigEditor(object):
                 opt_found = True
                 found = False
                 for val in opt["option_value"]:
-                    if (val["opt_type"] == "key_val" and 
+                    if (val["opt_type"] == "key_val" and
                             value["opt_type"] == "key_val"):
                         if str(val["opt_key"]) == str(value["opt_key"]):
                             val["opt_val"] = value["opt_val"]
                             found = True
-                    elif (val["opt_type"] == "single" and 
+                    elif (val["opt_type"] == "single" and
                             value["opt_type"] == "single"):
                         if str(val["opt_val"]) == str(value["opt_val"]):
                             found = True
@@ -802,5 +801,3 @@ class Grub2ConfigEditor(object):
             tmp.write("%s\n" % fmt)
         tmp.seek(0)
         return tmp.read()
-
-