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
8ccc0cde
authored
Feb 11, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
one: do not recontext if not needed
parent
6c99d3eb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
one/views.py
+5
-3
No files found.
one/views.py
View file @
8ccc0cde
...
@@ -193,7 +193,8 @@ def vm_saveas(request, vmid):
...
@@ -193,7 +193,8 @@ def vm_saveas(request, vmid):
@require_POST
@require_POST
@login_required
@login_required
def
vm_new
(
request
,
template
=
None
,
share
=
None
):
def
vm_new
(
request
,
template
=
None
,
share
=
None
):
base
=
None
base
=
None
extra
=
None
if
template
:
if
template
:
base
=
get_object_or_404
(
Template
,
pk
=
template
)
base
=
get_object_or_404
(
Template
,
pk
=
template
)
else
:
else
:
...
@@ -209,10 +210,11 @@ def vm_new(request, template=None, share=None):
...
@@ -209,10 +210,11 @@ def vm_new(request, template=None, share=None):
t
.
system
=
base
.
system
t
.
system
=
base
.
system
t
.
save
()
t
.
save
()
base
=
t
base
=
t
extra
=
"<RECONTEXT>YES</RECONTEXT>"
try
:
try
:
#Gány quota
#Gány quota
if
share
==
None
or
(
share
!=
None
and
share
.
get_running
()
<
share
.
instance_limit
):
if
share
==
None
or
(
share
!=
None
and
share
.
get_running
()
<
share
.
instance_limit
)
or
extra
:
i
=
Instance
.
submit
(
base
,
request
.
user
,
extra
=
"<RECONTEXT>YES</RECONTEXT>"
,
share
=
share
)
i
=
Instance
.
submit
(
base
,
request
.
user
,
extra
=
extra
,
share
=
share
)
return
redirect
(
i
)
return
redirect
(
i
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
error
(
'Failed to create virtual machine.'
+
unicode
(
e
))
logger
.
error
(
'Failed to create virtual machine.'
+
unicode
(
e
))
...
...
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