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
742b9423
authored
Mar 01, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: fix Host.save()
parent
f5d3ce91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
circle/firewall/models.py
+17
-17
No files found.
circle/firewall/models.py
View file @
742b9423
...
@@ -540,36 +540,36 @@ class Host(models.Model):
...
@@ -540,36 +540,36 @@ class Host(models.Model):
super
(
Host
,
self
)
.
save
(
*
args
,
**
kwargs
)
super
(
Host
,
self
)
.
save
(
*
args
,
**
kwargs
)
# IPv4
if
self
.
ipv4
is
not
None
:
if
self
.
ipv4
is
not
None
:
Record
.
objects
.
filter
(
host
=
self
,
name
=
self
.
hostname
,
# update existing records
type
=
'A'
)
.
update
(
address
=
self
.
ipv4
)
affected_records
=
Record
.
objects
.
filter
(
record_count
=
self
.
record_set
.
filter
(
host
=
self
,
host
=
self
,
name
=
self
.
hostname
,
name
=
self
.
hostname
,
type
=
'A'
)
.
update
(
address
=
self
.
ipv4
)
address
=
self
.
ipv4
,
# create new record
type
=
'A'
)
.
count
()
if
affected_records
==
0
:
if
record_count
==
0
:
Record
(
host
=
self
,
Record
(
host
=
self
,
name
=
self
.
hostname
,
name
=
self
.
hostname
,
domain
=
self
.
vlan
.
domain
,
domain
=
self
.
vlan
.
domain
,
address
=
self
.
ipv4
,
address
=
self
.
ipv4
,
owner
=
self
.
owner
,
owner
=
self
.
owner
,
description
=
'host.save()'
,
description
=
'
created by
host.save()'
,
type
=
'A'
)
.
save
()
type
=
'A'
)
.
save
()
if
self
.
ipv6
:
# IPv6
Record
.
objects
.
filter
(
host
=
self
,
name
=
self
.
hostname
,
if
self
.
ipv6
is
not
None
:
type
=
'AAAA'
)
.
update
(
address
=
self
.
ipv6
)
# update existing records
record_count
=
self
.
record_set
.
filter
(
host
=
self
,
affected_records
=
Record
.
objects
.
filter
(
name
=
self
.
hostname
,
host
=
self
,
name
=
self
.
hostname
,
address
=
self
.
ipv6
,
type
=
'AAAA'
)
.
update
(
address
=
self
.
ipv6
)
type
=
'AAAA'
)
.
count
()
# create new record
if
record_count
==
0
:
if
affected_records
==
0
:
Record
(
host
=
self
,
Record
(
host
=
self
,
name
=
self
.
hostname
,
name
=
self
.
hostname
,
domain
=
self
.
vlan
.
domain
,
domain
=
self
.
vlan
.
domain
,
address
=
self
.
ipv6
,
address
=
self
.
ipv6
,
owner
=
self
.
owner
,
owner
=
self
.
owner
,
description
=
'host.save()'
,
description
=
'
created by
host.save()'
,
type
=
'AAAA'
)
.
save
()
type
=
'AAAA'
)
.
save
()
def
enable_net
(
self
):
def
enable_net
(
self
):
...
...
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