Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-node
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-node
Commits
914dc8ec
Commit
914dc8ec
authored
13 years ago
by
Thibault VINCENT
Browse files
Options
Downloads
Patches
Plain Diff
fix: cleanup of volume copy handlers
parent
6a54e8e0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ccnode/handlers.py
+24
-9
24 additions, 9 deletions
ccnode/handlers.py
with
24 additions
and
9 deletions
ccnode/handlers.py
+
24
−
9
View file @
914dc8ec
...
...
@@ -691,6 +691,9 @@ class NodeHandler(RpcHandler):
# Storage control
##################################
###
# Volume management
@pure
def
vol_create
(
self
,
pool
,
name
,
size
):
'''
...
...
@@ -715,15 +718,23 @@ class NodeHandler(RpcHandler):
else
:
raise
NotImplementedError
(
'
host handler has no storage support
'
)
@pure
def
vol_copy
(
self
,
pool
,
name
,
dest_pool
,
dest_name
):
raise
NotImplementedError
()
###
# Basic network copy
@pure
def
vol_export
(
self
,
pool
,
name
,
raddr
,
rport
):
'''
'''
rport
=
int
(
rport
)
jmgr
=
self
.
_host_handle
.
jobmgr
if
hasattr
(
self
.
_host_handle
,
'
storage
'
):
#
get device path info
#
facilities
sto
=
self
.
_host_handle
.
storage
()
jmgr
=
self
.
_host_handle
.
jobmgr
# get device path
vol_path
=
sto
.
pool_get
(
pool
).
volume_get
(
name
).
get_path
()
# create job
job
=
SendFileJob
(
jmgr
,
vol_path
,
raddr
,
rport
)
...
...
@@ -747,12 +758,14 @@ class NodeHandler(RpcHandler):
'''
'''
if
hasattr
(
self
.
_host_handle
,
'
storage
'
):
#
get device path info
#
facilities
sto
=
self
.
_host_handle
.
storage
()
# get device path
vol_path
=
sto
.
pool_get
(
pool
).
volume_get
(
name
).
get_path
()
# create job
job
=
ReceiveFileJob
(
self
.
_host_handle
.
jobmgr
,
vol_path
)
# prepare job now, so we can fetch the port number below
# do the preparation immediately, so we can fetch the port number
# before the job starts
job
.
prepare
()
job
.
start_now
()
# return job info
...
...
@@ -787,7 +800,14 @@ class NodeHandler(RpcHandler):
'''
'''
jid
=
int
(
jid
)
# facilities
jmgr
=
self
.
_host_handle
.
jobmgr
# get the job
job
=
jmgr
.
get_job
(
jid
)
# check job type
if
job
.
get_type
()
!=
'
ReceiveFileJob
'
:
raise
HostError
(
'
this job ID does not match a volume import
'
)
# cancel it
jmgr
.
cancel
(
jid
)
###
...
...
@@ -882,11 +902,6 @@ class NodeHandler(RpcHandler):
# FIXME
job
.
drbd_stop
()
##################################
# Job management
##################################
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment