+ def save_network_template(self, template):
+ if (template.sharedNetworkName) and (not template.sharedNetworkId):
+ os_networks = self.driver.shell.quantum.list_networks(name=template.sharedNetworkName)['networks']
+ if os_networks:
+ template.sharedNetworkId = os_networks[0]["id"]
+
+ template.save()
+ template.enacted = datetime.now()
+ template.save(update_fields=['enacted'])
+