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
f6449395
authored
Feb 05, 2013
by
Őry, Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one: remove Hungarian strings from code
parent
8fed5420
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
one/models.py
+2
-2
one/views.py
+6
-6
No files found.
one/models.py
View file @
f6449395
...
@@ -225,11 +225,11 @@ Virtual machine instance.
...
@@ -225,11 +225,11 @@ Virtual machine instance.
"""
"""
class
Instance
(
models
.
Model
):
class
Instance
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
,
name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
,
verbose_name
=
_
(
'n
év
'
),
null
=
True
,
blank
=
True
)
verbose_name
=
_
(
'n
ame
'
),
null
=
True
,
blank
=
True
)
ip
=
models
.
IPAddressField
(
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
'IP address'
))
ip
=
models
.
IPAddressField
(
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
'IP address'
))
template
=
models
.
ForeignKey
(
Template
,
verbose_name
=
_
(
'template'
))
template
=
models
.
ForeignKey
(
Template
,
verbose_name
=
_
(
'template'
))
owner
=
models
.
ForeignKey
(
User
,
verbose_name
=
_
(
'owner'
))
owner
=
models
.
ForeignKey
(
User
,
verbose_name
=
_
(
'owner'
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
'created
_
at'
))
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
_
(
'created
at'
))
state
=
models
.
CharField
(
max_length
=
20
,
state
=
models
.
CharField
(
max_length
=
20
,
choices
=
[(
'DEPLOYABLE'
,
_
(
'deployable'
)),
choices
=
[(
'DEPLOYABLE'
,
_
(
'deployable'
)),
(
'PENDING'
,
_
(
'pending'
)),
(
'PENDING'
,
_
(
'pending'
)),
...
...
one/views.py
View file @
f6449395
# -*- coding: utf8 -*-
# -*- coding: utf
-
8 -*-
from
datetime
import
datetime
from
datetime
import
datetime
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth.decorators
import
login_required
from
django.contrib.auth.decorators
import
login_required
...
@@ -125,13 +125,13 @@ class VmPortAddView(View):
...
@@ -125,13 +125,13 @@ class VmPortAddView(View):
public
=
int
(
request
.
POST
[
'public'
])
public
=
int
(
request
.
POST
[
'public'
])
if
public
>=
22000
and
public
<
24000
:
if
public
>=
22000
and
public
<
24000
:
raise
ValidationError
(
"a port nem lehet 22000 es 24000 kozott"
)
raise
ValidationError
(
_
(
"Port number is in a restricted domain (22000 to 24000)."
)
)
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
inst
.
firewall_host
.
add_port
(
proto
=
request
.
POST
[
'proto'
],
public
=
public
,
private
=
int
(
request
.
POST
[
'private'
]))
inst
.
firewall_host
.
add_port
(
proto
=
request
.
POST
[
'proto'
],
public
=
public
,
private
=
int
(
request
.
POST
[
'private'
]))
reload_firewall_lock
()
reload_firewall_lock
()
messages
.
success
(
request
,
_
(
u"
A port hozzáadása sikerült."
)
)
messages
.
success
(
request
,
_
(
u"
Port
%
d successfully added."
)
%
public
)
except
:
except
:
messages
.
error
(
request
,
_
(
u"
Nem sikerült a kért művelet
"
))
messages
.
error
(
request
,
_
(
u"
Adding port failed.
"
))
# raise
# raise
return
redirect
(
'/vm/show/
%
d/'
%
int
(
iid
))
return
redirect
(
'/vm/show/
%
d/'
%
int
(
iid
))
...
@@ -148,9 +148,9 @@ def vm_port_del(request, iid, proto, public):
...
@@ -148,9 +148,9 @@ def vm_port_del(request, iid, proto, public):
try
:
try
:
inst
.
firewall_host
.
del_port
(
proto
=
proto
,
public
=
public
)
inst
.
firewall_host
.
del_port
(
proto
=
proto
,
public
=
public
)
reload_firewall_lock
()
reload_firewall_lock
()
messages
.
success
(
request
,
_
(
u"
A port törlése sikerült."
)
)
messages
.
success
(
request
,
_
(
u"
Port
%
d successfully removed."
)
%
public
)
except
:
except
:
messages
.
error
(
request
,
_
(
u"
Nem sikerült a kért művelet
"
))
messages
.
error
(
request
,
_
(
u"
Removing port failed.
"
))
return
redirect
(
'/vm/show/
%
d/'
%
int
(
iid
))
return
redirect
(
'/vm/show/
%
d/'
%
int
(
iid
))
class
VmDeleteView
(
View
):
class
VmDeleteView
(
View
):
...
...
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