Commit 6b20ceba by Bach Dániel

firewall: rename firewall fields

parent 79d910dc
......@@ -33,7 +33,6 @@
"hostname": "devenv",
"modified_at": "2014-02-24T15:55:01.412Z",
"location": "",
"pub_ipv4": null,
"mac": "11:22:33:44:55:66",
"shared_ip": false,
"ipv4": "10.7.0.96",
......
......@@ -16,7 +16,7 @@ class RecordInline(contrib.admin.TabularInline):
class HostAdmin(admin.ModelAdmin):
list_display = ('hostname', 'vlan', 'ipv4', 'ipv6', 'pub_ipv4', 'mac',
list_display = ('hostname', 'vlan', 'ipv4', 'ipv6', 'external_ipv4', 'mac',
'shared_ip', 'owner', 'description', 'reverse',
'list_groups')
ordering = ('hostname', )
......@@ -49,7 +49,7 @@ class VlanAdmin(admin.ModelAdmin):
class RuleAdmin(admin.ModelAdmin):
list_display = ('r_type', 'color_desc', 'owner', 'extra', 'direction',
'accept', 'proto', 'sport', 'dport', 'nat',
'nat_dport', 'used_in')
'nat_external_port', 'used_in')
list_filter = ('vlan', 'owner', 'direction', 'accept',
'proto', 'nat')
......
......@@ -48,7 +48,7 @@ def periodic_task():
@celery.task
def reloadtask(type='Host'):
def reloadtask(type='Host', timeout=15):
reload = {
'Host': ['dns', 'dhcp', 'firewall'],
'Record': ['dns'],
......
......@@ -96,12 +96,12 @@ class HostGetHostnameTestCase(TestCase):
self.vlan.save()
self.h = Host(hostname='h', mac='01:02:03:04:05:00', ipv4='10.0.0.1',
vlan=self.vlan, owner=self.u1, shared_ip=True,
pub_ipv4=self.vlan.snat_ip)
external_ipv4=self.vlan.snat_ip)
self.h.save()
def test_issue_93_wo_record(self):
self.assertEqual(self.h.get_hostname(proto='ipv4', public=True),
unicode(self.h.pub_ipv4))
unicode(self.h.external_ipv4))
def test_issue_93_w_record(self):
self.r = Record(name='vm', type='A', domain=self.d, owner=self.u1,
......
......@@ -167,7 +167,8 @@ class RuleForm(ModelForm):
'accept',
'owner',
'nat',
'nat_dport',
'nat_external_port',
'nat_external_ipv4',
),
Fieldset(
'External',
......
......@@ -128,7 +128,8 @@ class RuleTable(Table):
model = Rule
attrs = {'class': 'table table-striped table-hover table-condensed'}
fields = ('r_type', 'color_desc', 'owner', 'extra', 'direction',
'accept', 'proto', 'sport', 'dport', 'nat', 'nat_dport', )
'accept', 'proto', 'sport', 'dport', 'nat',
'nat_external_port', )
order_by = 'direction'
......
......@@ -33,5 +33,6 @@
{% if record.nat %}
<span class="label label-success">NAT
[ {{ record.dport }} <i class="icon-arrow-right"></i> {{record.nat_dport}} ]</span>
[ {{ record.dport }} <i class="icon-arrow-right"></i>
{{record.nat_external_port}} ]</span>
{% endif %}
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