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
7c658a86
authored
Jul 14, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: use HRO for result strings
parent
dbe6fd36
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
circle/vm/models/network.py
+9
-5
No files found.
circle/vm/models/network.py
View file @
7c658a86
...
...
@@ -21,8 +21,9 @@ from logging import getLogger
from
netaddr
import
EUI
,
mac_unix
from
django.db.models
import
Model
,
ForeignKey
,
BooleanField
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
,
ugettext_noop
from
common.models
import
create_readable
from
firewall.models
import
Vlan
,
Host
from
..tasks
import
net_tasks
from
.activity
import
instance_activity
...
...
@@ -127,10 +128,13 @@ class Interface(Model):
addresses
=
vlan
.
get_new_address
()
host
.
ipv4
=
addresses
[
'ipv4'
]
host
.
ipv6
=
addresses
[
'ipv6'
]
act
.
result
=
(
'new addresses: ipv4:
%(ip4)
s, ipv6:
%(ip6)
s, '
'vlan:
%(vlan)
s'
%
{
'ip4'
:
host
.
ipv4
,
'ip6'
:
host
.
ipv6
,
'vlan'
:
vlan
.
name
})
act
.
result
=
create_readable
(
ugettext_noop
(
"Interface successfully created."
),
ugettext_noop
(
"Interface successfully created. "
"New addresses: ipv4:
%(ip4)
s, "
"ipv6:
%(ip6)
s, vlan:
%(vlan)
s."
),
ip4
=
unicode
(
host
.
ipv4
),
ip6
=
unicode
(
host
.
ipv6
),
vlan
=
vlan
.
name
)
host
.
owner
=
owner
if
vlan
.
network_type
==
'public'
:
host
.
shared_ip
=
False
...
...
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