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
357402a5
authored
Sep 13, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding functional manager/celery
parent
1105ebab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
circle/storage/models.py
+6
-5
No files found.
circle/storage/models.py
View file @
357402a5
...
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.db.models.signals
import
post_delete
from
django.db.models.signals
import
post_delete
from
model_utils.models
import
TimeStampedModel
from
model_utils.models
import
TimeStampedModel
import
manager.storage
from
manager
import
storage_manager
from
.
import
tasks
from
.
import
tasks
...
@@ -99,7 +99,7 @@ class Disk(TimeStampedModel):
...
@@ -99,7 +99,7 @@ class Disk(TimeStampedModel):
return
u"
%
s (#
%
d)"
%
(
self
.
name
,
self
.
id
)
return
u"
%
s (#
%
d)"
%
(
self
.
name
,
self
.
id
)
def
deploy_async
(
self
):
def
deploy_async
(
self
):
manager
.
storage
.
deploy
.
apply_async
(
self
)
storage_manager
.
deploy
.
apply_async
(
self
)
def
deploy
(
self
):
def
deploy
(
self
):
"""Reify the disk model on the associated data store.
"""Reify the disk model on the associated data store.
...
@@ -115,14 +115,15 @@ class Disk(TimeStampedModel):
...
@@ -115,14 +115,15 @@ class Disk(TimeStampedModel):
return
False
return
False
disk_desc
=
{
disk_desc
=
{
'name'
:
self
.
name
,
'name'
:
self
.
file
name
,
'dir'
:
self
.
datastore
.
path
,
'dir'
:
self
.
datastore
.
path
,
'format'
:
self
.
format
,
'format'
:
self
.
format
,
'size'
:
self
.
size
,
'size'
:
self
.
size
,
'base_name'
:
self
.
base
.
name
if
self
.
base
else
None
,
'base_name'
:
self
.
base
.
name
if
self
.
base
else
None
,
'type'
:
self
.
type
'type'
:
'snapshot'
if
self
.
type
==
'qcow2-snap'
else
'normal'
}
}
tasks
.
create_disk
.
delay
(
disk_desc
)
.
get
()
tasks
.
create_disk
.
apply_async
(
args
=
[
disk_desc
],
queue
=
self
.
datastore
.
hostname
+
".storage"
)
.
get
()
self
.
ready
=
True
self
.
ready
=
True
self
.
save
()
self
.
save
()
return
True
return
True
...
...
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