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
cba7c34e
authored
Mar 08, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: fix handling of MX and multiple A records
parent
969bd40c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
firewall/models.py
+1
-1
one/models.py
+1
-2
No files found.
firewall/models.py
View file @
cba7c34e
...
@@ -296,7 +296,7 @@ class Record(models.Model):
...
@@ -296,7 +296,7 @@ class Record(models.Model):
raise
ValidationError
(
_
(
"Unknown record type."
))
raise
ValidationError
(
_
(
"Unknown record type."
))
def
__get_name
(
self
):
def
__get_name
(
self
):
if
self
.
host
:
if
self
.
host
and
self
.
type
!=
'MX'
:
if
self
.
type
in
[
'A'
,
'AAAA'
]:
if
self
.
type
in
[
'A'
,
'AAAA'
]:
return
self
.
host
.
get_fqdn
()
return
self
.
host
.
get_fqdn
()
elif
self
.
type
==
'CNAME'
:
elif
self
.
type
==
'CNAME'
:
...
...
one/models.py
View file @
cba7c34e
...
@@ -420,11 +420,10 @@ class Instance(models.Model):
...
@@ -420,11 +420,10 @@ class Instance(models.Model):
else
:
else
:
if
self
.
template
.
network
.
nat
:
if
self
.
template
.
network
.
nat
:
ip
=
self
.
firewall_host
.
pub_ipv4
ip
=
self
.
firewall_host
.
pub_ipv4
return
Record
.
objects
.
get
(
type
=
'A'
,
address
=
ip
)
.
get_data
()[
'name'
]
return
Record
.
objects
.
filter
(
type
=
'A'
,
address
=
ip
)[
0
]
.
get_data
()[
'name'
]
else
:
else
:
return
self
.
firewall_host
.
record_set
.
filter
(
type
=
'A'
)[
0
]
.
get_data
()[
'name'
]
return
self
.
firewall_host
.
record_set
.
filter
(
type
=
'A'
)[
0
]
.
get_data
()[
'name'
]
except
:
except
:
raise
if
self
.
template
.
network
.
nat
:
if
self
.
template
.
network
.
nat
:
return
self
.
firewall_host
.
pub_ipv4
return
self
.
firewall_host
.
pub_ipv4
else
:
else
:
...
...
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