Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
96215507
authored
Mar 18, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: fix vm/template create tests
parent
7278c20e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
circle/dashboard/fixtures/test-vm-fixture.json
+1
-1
circle/dashboard/tests/test_views.py
+3
-0
circle/vm/models/instance.py
+1
-1
No files found.
circle/dashboard/fixtures/test-vm-fixture.json
View file @
96215507
...
...
@@ -1497,7 +1497,7 @@
"boot_menu"
:
false
,
"ram_size"
:
1024
,
"modified"
:
"2014-01-24T00:58:19.654Z"
,
"system"
:
""
,
"system"
:
"
bubuntu
"
,
"priority"
:
20
,
"access_method"
:
"ssh"
,
"raw_data"
:
""
,
...
...
circle/dashboard/tests/test_views.py
View file @
96215507
...
...
@@ -187,6 +187,7 @@ class VmDetailTest(LoginMixin, TestCase):
Vlan
.
objects
.
get
(
id
=
1
)
.
set_level
(
self
.
u1
,
'user'
)
response
=
c
.
post
(
'/dashboard/vm/create/'
,
{
'template'
:
1
,
'system'
:
"bubi"
,
'cpu_priority'
:
1
,
'cpu_count'
:
1
,
'ram_size'
:
1000
})
self
.
assertEqual
(
response
.
status_code
,
403
)
...
...
@@ -199,6 +200,7 @@ class VmDetailTest(LoginMixin, TestCase):
Vlan
.
objects
.
get
(
id
=
1
)
.
set_level
(
self
.
u1
,
'user'
)
response
=
c
.
post
(
'/dashboard/vm/create/'
,
{
'template'
:
1
,
'system'
:
"bubi"
,
'cpu_priority'
:
1
,
'cpu_count'
:
1
,
'ram_size'
:
1000
})
self
.
assertEqual
(
response
.
status_code
,
302
)
...
...
@@ -208,6 +210,7 @@ class VmDetailTest(LoginMixin, TestCase):
self
.
login
(
c
,
'superuser'
)
response
=
c
.
post
(
'/dashboard/vm/create/'
,
{
'template'
:
1
,
'system'
:
"bubi"
,
'cpu_priority'
:
1
,
'cpu_count'
:
1
,
'ram_size'
:
1000
})
self
.
assertEqual
(
response
.
status_code
,
302
)
...
...
circle/vm/models/instance.py
View file @
96215507
...
...
@@ -378,7 +378,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel,
# prepare parameters
common_fields
=
[
'name'
,
'description'
,
'num_cores'
,
'ram_size'
,
'max_ram_size'
,
'arch'
,
'priority'
,
'boot_menu'
,
'raw_data'
,
'lease'
,
'access_method'
]
'raw_data'
,
'lease'
,
'access_method'
,
'system'
]
params
=
dict
(
template
=
template
,
owner
=
owner
,
pw
=
pwgen
())
params
.
update
([(
f
,
getattr
(
template
,
f
))
for
f
in
common_fields
])
params
.
update
(
kwargs
)
# override defaults w/ user supplied values
...
...
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