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
c980e3ae
authored
Sep 27, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage: add activity logging to deploy
parent
19cd54c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
circle/storage/models.py
+12
-0
No files found.
circle/storage/models.py
View file @
c980e3ae
...
@@ -147,18 +147,30 @@ class Disk(TimeStampedModel):
...
@@ -147,18 +147,30 @@ class Disk(TimeStampedModel):
if
self
.
ready
:
if
self
.
ready
:
return
False
return
False
act
=
DiskActivity
(
activity_code
=
'storage.Disk.deploy'
)
act
.
disk
=
self
act
.
started
=
timezone
.
now
()
act
.
state
=
'PENDING'
act
.
task_uuid
=
task_uuid
act
.
user
=
user
act
.
save
()
# Delegate create / snapshot jobs
# Delegate create / snapshot jobs
queue_name
=
self
.
datastore
.
hostname
+
".storage"
queue_name
=
self
.
datastore
.
hostname
+
".storage"
disk_desc
=
self
.
get_disk_desc
()
disk_desc
=
self
.
get_disk_desc
()
if
self
.
type
==
'qcow2-snap'
:
if
self
.
type
==
'qcow2-snap'
:
act
.
update_state
(
'CREATING SNAPSHOT'
)
remote_tasks
.
snapshot
.
apply_async
(
args
=
[
disk_desc
],
remote_tasks
.
snapshot
.
apply_async
(
args
=
[
disk_desc
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
else
:
else
:
act
.
update_state
(
'CREATING DISK'
)
remote_tasks
.
create
.
apply_async
(
args
=
[
disk_desc
],
remote_tasks
.
create
.
apply_async
(
args
=
[
disk_desc
],
queue
=
queue_name
)
.
get
()
queue
=
queue_name
)
.
get
()
self
.
ready
=
True
self
.
ready
=
True
self
.
save
()
self
.
save
()
act
.
finish
(
'SUCCESS'
)
return
True
return
True
def
deploy_async
(
self
,
user
=
None
):
def
deploy_async
(
self
,
user
=
None
):
...
...
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