Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
746b4b08
authored
Feb 25, 2021
by
Máhonfai Bálint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch disk import to SSH
parent
239f9e7b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
5 deletions
+4
-5
circle/storage/models.py
+2
-2
circle/vm/operations.py
+2
-3
No files found.
circle/storage/models.py
View file @
746b4b08
...
@@ -477,7 +477,7 @@ class Disk(TimeStampedModel):
...
@@ -477,7 +477,7 @@ class Disk(TimeStampedModel):
return
disk
return
disk
@classmethod
@classmethod
def
import_disk
(
cls
,
user
,
name
,
download_link
,
task
):
def
import_disk
(
cls
,
user
,
name
,
download_link
,
port
,
task
):
params
=
{
'name'
:
name
,
params
=
{
'name'
:
name
,
'type'
:
'qcow2-norm'
}
'type'
:
'qcow2-norm'
}
disk
=
cls
.
__create
(
user
=
user
,
params
=
params
)
disk
=
cls
.
__create
(
user
=
user
,
params
=
params
)
...
@@ -486,7 +486,7 @@ class Disk(TimeStampedModel):
...
@@ -486,7 +486,7 @@ class Disk(TimeStampedModel):
kwargs
=
{
kwargs
=
{
"disk_desc"
:
disk
.
get_disk_desc
(),
"disk_desc"
:
disk
.
get_disk_desc
(),
"url"
:
download_link
,
"url"
:
download_link
,
"
task"
:
task
.
request
.
id
"
port"
:
port
},
},
queue
=
queue_name
queue
=
queue_name
)
)
...
...
circle/vm/operations.py
View file @
746b4b08
...
@@ -352,7 +352,6 @@ class ImportDiskOperation(InstanceOperation):
...
@@ -352,7 +352,6 @@ class ImportDiskOperation(InstanceOperation):
'from the user store. The disk image has to be in the '
'from the user store. The disk image has to be in the '
'root directory of the store.'
)
'root directory of the store.'
)
abortable
=
True
abortable
=
True
has_percentage
=
True
required_perms
=
(
'storage.import_disk'
,)
required_perms
=
(
'storage.import_disk'
,)
accept_states
=
(
'STOPPED'
,
'PENDING'
,
'RUNNING'
)
accept_states
=
(
'STOPPED'
,
'PENDING'
,
'RUNNING'
)
async_queue
=
'localhost.man.slow'
async_queue
=
'localhost.man.slow'
...
@@ -366,8 +365,8 @@ class ImportDiskOperation(InstanceOperation):
...
@@ -366,8 +365,8 @@ class ImportDiskOperation(InstanceOperation):
def
_operation
(
self
,
user
,
name
,
disk_path
,
task
):
def
_operation
(
self
,
user
,
name
,
disk_path
,
task
):
store
=
Store
(
user
)
store
=
Store
(
user
)
download_link
=
store
.
request
_download
(
disk_path
)
download_link
,
port
=
store
.
request_ssh
_download
(
disk_path
)
disk
=
Disk
.
import_disk
(
user
,
name
,
download_link
,
task
)
disk
=
Disk
.
import_disk
(
user
,
name
,
download_link
,
port
,
task
)
self
.
instance
.
disks
.
add
(
disk
)
self
.
instance
.
disks
.
add
(
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