Commit cc6205bd by Bach Dániel

vm: fix Interface.create

parent 1a2eab74
...@@ -38,7 +38,7 @@ class HostAdmin(admin.ModelAdmin): ...@@ -38,7 +38,7 @@ class HostAdmin(admin.ModelAdmin):
class HostInline(contrib.admin.TabularInline): class HostInline(contrib.admin.TabularInline):
model = Host model = Host
fields = ('hostname', 'ipv4', 'ipv6', 'pub_ipv4', 'mac', 'shared_ip', fields = ('hostname', 'ipv4', 'ipv6', 'external_ipv4', 'mac', 'shared_ip',
'owner', 'reverse') 'owner', 'reverse')
......
...@@ -120,10 +120,10 @@ class Interface(Model): ...@@ -120,10 +120,10 @@ class Interface(Model):
host.owner = owner host.owner = owner
if vlan.network_type == 'public': if vlan.network_type == 'public':
host.shared_ip = False host.shared_ip = False
host.pub_ipv4 = None host.external_ipv4 = None
elif vlan.network_type == 'portforward': elif vlan.network_type == 'portforward':
host.shared_ip = True host.shared_ip = True
host.pub_ipv4 = vlan.snat_ip host.external_ipv4 = vlan.snat_ip
host.full_clean() host.full_clean()
host.save() host.save()
host.enable_net() host.enable_net()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment