Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c381ac63
authored
Feb 06, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add field for resultant state to instance activities
parent
c86086a5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
circle/vm/migrations/0015_add_field_InstanceActivity_resultant_state.py
+0
-0
circle/vm/models/activity.py
+6
-5
No files found.
circle/vm/migrations/0015_add_field_InstanceActivity_resultant_state.py
0 → 100644
View file @
c381ac63
This diff is collapsed.
Click to expand it.
circle/vm/models/activity.py
View file @
c381ac63
...
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
...
@@ -2,7 +2,7 @@ from __future__ import absolute_import, unicode_literals
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
from
logging
import
getLogger
from
logging
import
getLogger
from
django.db.models
import
ForeignKey
from
django.db.models
import
CharField
,
ForeignKey
from
django.utils
import
timezone
from
django.utils
import
timezone
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
...
@@ -26,6 +26,7 @@ class InstanceActivity(ActivityModel):
...
@@ -26,6 +26,7 @@ class InstanceActivity(ActivityModel):
instance
=
ForeignKey
(
'Instance'
,
related_name
=
'activity_log'
,
instance
=
ForeignKey
(
'Instance'
,
related_name
=
'activity_log'
,
help_text
=
_
(
'Instance this activity works on.'
),
help_text
=
_
(
'Instance this activity works on.'
),
verbose_name
=
_
(
'instance'
))
verbose_name
=
_
(
'instance'
))
resultant_state
=
CharField
(
blank
=
True
,
max_length
=
20
,
null
=
True
)
class
Meta
:
class
Meta
:
app_label
=
'vm'
app_label
=
'vm'
...
@@ -47,16 +48,16 @@ class InstanceActivity(ActivityModel):
...
@@ -47,16 +48,16 @@ class InstanceActivity(ActivityModel):
@classmethod
@classmethod
def
create
(
cls
,
code_suffix
,
instance
,
task_uuid
=
None
,
user
=
None
):
def
create
(
cls
,
code_suffix
,
instance
,
task_uuid
=
None
,
user
=
None
):
act
=
cls
(
activity_code
=
'vm.Instance.'
+
code_suffix
,
act
=
cls
(
activity_code
=
'vm.Instance.'
+
code_suffix
,
instance
=
instance
,
parent
=
None
,
started
=
timezone
.
now
()
,
instance
=
instance
,
parent
=
None
,
resultant_state
=
None
,
task_uuid
=
task_uuid
,
user
=
user
)
started
=
timezone
.
now
(),
task_uuid
=
task_uuid
,
user
=
user
)
act
.
save
()
act
.
save
()
return
act
return
act
def
create_sub
(
self
,
code_suffix
,
task_uuid
=
None
):
def
create_sub
(
self
,
code_suffix
,
task_uuid
=
None
):
act
=
InstanceActivity
(
act
=
InstanceActivity
(
activity_code
=
self
.
activity_code
+
'.'
+
code_suffix
,
activity_code
=
self
.
activity_code
+
'.'
+
code_suffix
,
instance
=
self
.
instance
,
parent
=
self
,
started
=
timezone
.
now
()
,
instance
=
self
.
instance
,
parent
=
self
,
resultant_state
=
None
,
task_uuid
=
task_uuid
,
user
=
self
.
user
)
started
=
timezone
.
now
(),
task_uuid
=
task_uuid
,
user
=
self
.
user
)
act
.
save
()
act
.
save
()
return
act
return
act
...
...
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