Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
f3a566cf
authored
Jan 31, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: refactor host fqdn
refs #28
parent
bc3656cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
+5
-1
firewall/fw.py
+1
-1
firewall/models.py
+4
-0
No files found.
firewall/fw.py
View file @
f3a566cf
...
@@ -360,7 +360,7 @@ def dns():
...
@@ -360,7 +360,7 @@ def dns():
for
i_host
in
i_vlan
.
host_set
.
all
():
for
i_host
in
i_vlan
.
host_set
.
all
():
ipv4
=
(
i_host
.
pub_ipv4
if
i_host
.
pub_ipv4
and
not
i_host
.
shared_ip
else
i_host
.
ipv4
)
ipv4
=
(
i_host
.
pub_ipv4
if
i_host
.
pub_ipv4
and
not
i_host
.
shared_ip
else
i_host
.
ipv4
)
reverse
=
i_host
.
reverse
if
(
i_host
.
reverse
and
len
(
i_host
.
reverse
))
else
i_host
.
hostname
+
u'.'
+
i_vlan
.
domain
reverse
=
i_host
.
reverse
if
(
i_host
.
reverse
and
len
(
i_host
.
reverse
))
else
i_host
.
hostname
+
u'.'
+
i_vlan
.
domain
hostname
=
i_host
.
hostname
+
u'.'
+
i_vlan
.
domain
hostname
=
i_host
.
get_fqdn
()
# ipv4
# ipv4
if
i_host
.
ipv4
:
if
i_host
.
ipv4
:
...
...
firewall/models.py
View file @
f3a566cf
...
@@ -179,6 +179,10 @@ class Host(models.Model):
...
@@ -179,6 +179,10 @@ class Host(models.Model):
def
del_rules
(
self
):
def
del_rules
(
self
):
self
.
rules
.
filter
(
owner
=
self
.
owner
)
.
delete
()
self
.
rules
.
filter
(
owner
=
self
.
owner
)
.
delete
()
def
get_fqdn
(
self
):
return
self
.
hostname
+
u'.'
+
self
.
vlan
.
domain
class
Firewall
(
models
.
Model
):
class
Firewall
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
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