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
2c38e827
authored
Jul 29, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add dummy MountStoreOperation
parent
961735ad
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
circle/dashboard/views.py
+2
-0
circle/vm/operations.py
+32
-0
No files found.
circle/dashboard/views.py
View file @
2c38e827
...
@@ -881,6 +881,8 @@ vm_ops = OrderedDict([
...
@@ -881,6 +881,8 @@ vm_ops = OrderedDict([
op
=
'sleep'
,
icon
=
'moon-o'
,
effect
=
'info'
)),
op
=
'sleep'
,
icon
=
'moon-o'
,
effect
=
'info'
)),
(
'migrate'
,
VmMigrateView
),
(
'migrate'
,
VmMigrateView
),
(
'save_as_template'
,
VmSaveView
),
(
'save_as_template'
,
VmSaveView
),
(
'mount_store'
,
VmOperationView
.
factory
(
op
=
'mount_store'
,
icon
=
'briefcase'
,
effect
=
'info'
)),
(
'reboot'
,
VmOperationView
.
factory
(
(
'reboot'
,
VmOperationView
.
factory
(
op
=
'reboot'
,
icon
=
'refresh'
,
effect
=
'warning'
)),
op
=
'reboot'
,
icon
=
'refresh'
,
effect
=
'warning'
)),
(
'reset'
,
VmOperationView
.
factory
(
(
'reset'
,
VmOperationView
.
factory
(
...
...
circle/vm/operations.py
View file @
2c38e827
...
@@ -904,3 +904,35 @@ class PasswordResetOperation(InstanceOperation):
...
@@ -904,3 +904,35 @@ class PasswordResetOperation(InstanceOperation):
register_operation
(
PasswordResetOperation
)
register_operation
(
PasswordResetOperation
)
class
MountStoreOperation
(
InstanceOperation
):
activity_code_suffix
=
'mount_store'
id
=
'mount_store'
name
=
_
(
"mount store"
)
description
=
_
(
"This operation exposes your personal files and your store"
"credentials to other users of this virtual machine (if any)."
)
acl_level
=
"owner"
required_perms
=
()
def
check_precond
(
self
):
super
(
MountStoreOperation
,
self
)
.
check_precond
()
if
self
.
instance
.
status
not
in
[
"RUNNING"
]:
raise
self
.
instance
.
WrongStateError
(
self
.
instance
)
def
_operation
(
self
):
inst
=
self
.
instance
queue
=
self
.
instance
.
get_remote_queue_name
(
"agent"
)
# TODO
# host = urlsplit(settings.STORE_URL).netloc
host
=
'10.0.0.24'
# username = Store(inst.owner).username
username
=
'u-1'
# password = inst.owner.profile.smb_password
password
=
'asd'
agent_tasks
.
mount_store
.
apply_async
(
queue
=
queue
,
args
=
(
inst
.
vm_name
,
host
,
username
,
password
))
register_operation
(
MountStoreOperation
)
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