Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
0eb1fbe1
authored
Jul 05, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into feature-fix-acls
parents
79a46294
9d49beaf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
circle/dashboard/templates/dashboard/vm-detail/_operations.html
+1
-1
circle/vm/models/node.py
+6
-2
circle/vm/operations.py
+7
-0
No files found.
circle/dashboard/templates/dashboard/vm-detail/_operations.html
View file @
0eb1fbe1
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
{% if op.show_in_toolbar %}
{% if op.show_in_toolbar %}
{% if op.disabled %}
{% if op.disabled %}
<span
class=
"operation operation-{{op.op}} btn btn-
{{op.effect}}
disabled btn-xs"
>
<span
class=
"operation operation-{{op.op}} btn btn-
default
disabled btn-xs"
>
{% else %}
{% else %}
<a
href=
"{{op.get_url}}"
class=
"operation operation-{{op.op}} btn
<a
href=
"{{op.get_url}}"
class=
"operation operation-{{op.op}} btn
btn-{{op.effect}} btn-xs"
title=
"{{op.name}}: {{op.description}}"
>
btn-{{op.effect}} btn-xs"
title=
"{{op.name}}: {{op.description}}"
>
...
...
circle/vm/models/node.py
View file @
0eb1fbe1
...
@@ -148,10 +148,14 @@ class Node(OperatedMixin, TimeStampedModel):
...
@@ -148,10 +148,14 @@ class Node(OperatedMixin, TimeStampedModel):
self
.
enabled
=
False
self
.
enabled
=
False
self
.
save
()
self
.
save
()
def
enable
(
self
,
user
=
None
):
def
enable
(
self
,
user
=
None
,
base_activity
=
None
):
''' Enable the node. '''
''' Enable the node. '''
if
self
.
enabled
is
not
True
:
if
self
.
enabled
is
not
True
:
with
node_activity
(
code_suffix
=
'enable'
,
node
=
self
,
user
=
user
):
if
base_activity
:
act_ctx
=
base_activity
.
sub_activity
(
'enable'
)
else
:
act_ctx
=
node_activity
(
'enable'
,
node
=
self
,
user
=
user
)
with
act_ctx
:
self
.
enabled
=
True
self
.
enabled
=
True
self
.
save
()
self
.
save
()
self
.
get_info
(
invalidate_cache
=
True
)
self
.
get_info
(
invalidate_cache
=
True
)
...
...
circle/vm/operations.py
View file @
0eb1fbe1
...
@@ -649,7 +649,14 @@ class FlushOperation(NodeOperation):
...
@@ -649,7 +649,14 @@ class FlushOperation(NodeOperation):
description
=
_
(
"Disable node and move all instances to other ones."
)
description
=
_
(
"Disable node and move all instances to other ones."
)
required_perms
=
()
required_perms
=
()
def
on_abort
(
self
,
activity
,
error
):
from
manager.scheduler
import
TraitsUnsatisfiableException
if
isinstance
(
error
,
TraitsUnsatisfiableException
):
if
self
.
node_enabled
:
self
.
node
.
enable
(
activity
.
user
,
activity
)
def
_operation
(
self
,
activity
,
user
):
def
_operation
(
self
,
activity
,
user
):
self
.
node_enabled
=
self
.
node
.
enabled
self
.
node
.
disable
(
user
,
activity
)
self
.
node
.
disable
(
user
,
activity
)
for
i
in
self
.
node
.
instance_set
.
all
():
for
i
in
self
.
node
.
instance_set
.
all
():
with
activity
.
sub_activity
(
'migrate_instance_
%
d'
%
i
.
pk
):
with
activity
.
sub_activity
(
'migrate_instance_
%
d'
%
i
.
pk
):
...
...
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