Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b83f3147
authored
Feb 05, 2013
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: remove Alias
parent
8d049e20
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
28 deletions
+0
-28
firewall/admin.py
+0
-4
firewall/fw.py
+0
-8
firewall/models.py
+0
-16
No files found.
firewall/admin.py
View file @
b83f3147
...
...
@@ -5,9 +5,6 @@ from firewall.models import *
from
django
import
contrib
class
AliasInline
(
contrib
.
admin
.
TabularInline
):
model
=
Alias
class
RuleInline
(
contrib
.
admin
.
TabularInline
):
model
=
Rule
...
...
@@ -94,7 +91,6 @@ class RecordAdmin(admin.ModelAdmin):
admin
.
site
.
register
(
Host
,
HostAdmin
)
admin
.
site
.
register
(
Vlan
,
VlanAdmin
)
admin
.
site
.
register
(
Rule
,
RuleAdmin
)
admin
.
site
.
register
(
Alias
,
AliasAdmin
)
admin
.
site
.
register
(
Group
,
GroupAdmin
)
admin
.
site
.
register
(
VlanGroup
)
admin
.
site
.
register
(
Firewall
,
FirewallAdmin
)
...
...
firewall/fw.py
View file @
b83f3147
...
...
@@ -339,14 +339,6 @@ def dns():
vlans
=
models
.
Vlan
.
objects
.
all
()
regex
=
re
.
compile
(
r'^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$'
)
DNS
=
[]
DNS
.
append
(
"=cloud.ik.bme.hu:152.66.243.98:600::"
)
DNS
.
append
(
":cloud.ik.bme.hu:28:
\040\001\007\070\040\001\100\061\000\002\000\000\000\007\000\000
:600"
)
DNS
.
append
(
"=r.cloud.ik.bme.hu:152.66.243.62:600::"
)
DNS
.
append
(
"Z1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa:dns1.ik.bme.hu:support.ik.bme.hu::::::600"
)
# soa
DNS
.
append
(
"&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::dns1.ik.bme.hu:600::"
)
# ns rekord
DNS
.
append
(
"&1.3.0.4.1.0.0.2.8.3.7.0.1.0.0.2.ip6.arpa::nic.bme.hu:600::"
)
# ns rekord
for
i_vlan
in
vlans
:
m
=
regex
.
search
(
i_vlan
.
net4
)
...
...
firewall/models.py
View file @
b83f3147
...
...
@@ -109,22 +109,6 @@ class Group(models.Model):
def
__unicode__
(
self
):
return
self
.
name
class
Alias
(
models
.
Model
):
host
=
models
.
ForeignKey
(
'Host'
)
alias
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
validators
=
[
val_domain
])
owner
=
models
.
ForeignKey
(
User
,
null
=
True
,
blank
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified_at
=
models
.
DateTimeField
(
auto_now
=
True
)
def
clean
(
self
):
# FIXME later: critical race condition
for
h
in
Host
.
objects
.
all
():
if
h
.
get_fqdn
()
==
self
.
alias
:
raise
ValidationError
(
_
(
"Host name already used."
))
class
Meta
:
verbose_name_plural
=
'aliases'
class
Host
(
models
.
Model
):
hostname
=
models
.
CharField
(
max_length
=
40
,
unique
=
True
,
validators
=
[
val_alfanum
])
reverse
=
models
.
CharField
(
max_length
=
40
,
validators
=
[
val_domain
],
blank
=
True
,
null
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment