Update the nics.hostname field to keep it in sync with machine.name
[invirt/packages/invirt-web.git] / code / main.py
index 908d7cd..d9cc14c 100755 (executable)
@@ -379,6 +379,9 @@ def modifyDict(username, state, fields):
             update_acl = True
         if hasattr(validate, 'name'):
             machine.name = validate.name
+            for n in machine.nics:
+                if n.hostname == oldname:
+                    n.hostname = validate.name
         if hasattr(validate, 'description'):
             machine.description = validate.description
         if hasattr(validate, 'admin') and validate.admin != machine.administrator: