Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
64e0a1f0
authored
Sep 23, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm/operation: add ResizeDiskOperation
parent
35f603ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
circle/vm/operations.py
+23
-0
No files found.
circle/vm/operations.py
View file @
64e0a1f0
...
...
@@ -208,6 +208,29 @@ class CreateDiskOperation(InstanceOperation):
register_operation
(
CreateDiskOperation
)
class
ResizeDiskOperation
(
InstanceOperation
):
activity_code_suffix
=
'resize_disk'
id
=
'resize_disk'
name
=
_
(
"resize disk"
)
description
=
_
(
"Resize the virtual disk image. "
"Size must be greater value than the actual size."
)
required_perms
=
(
'vm.resize_disk'
,
)
accept_states
=
(
'RUNNING'
)
def
_operation
(
self
,
user
,
disk
,
size
,
activity
):
if
self
.
instance
.
is_running
:
self
.
instance
.
resize_disk
(
disk
,
size
)
def
get_activity_name
(
self
,
kwargs
):
return
create_readable
(
ugettext_noop
(
"resize disk
%(name)
s to
%(size)
s"
),
size
=
filesizeformat
(
kwargs
[
'size'
]),
name
=
kwargs
[
'disk'
]
.
name
)
register_operation
(
ResizeDiskOperation
)
class
DownloadDiskOperation
(
InstanceOperation
):
activity_code_suffix
=
'download_disk'
id
=
'download_disk'
...
...
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