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
6487ae94
authored
Jan 08, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: assign locally unique device numbers to disks on deploy
parent
4b4735b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
circle/vm/models/instance.py
+9
-0
No files found.
circle/vm/models/instance.py
View file @
6487ae94
...
...
@@ -2,6 +2,7 @@ from __future__ import absolute_import, unicode_literals
from
datetime
import
timedelta
from
logging
import
getLogger
from
importlib
import
import_module
import
string
import
django.conf
from
django.db.models
import
(
BooleanField
,
CharField
,
DateTimeField
,
...
...
@@ -480,7 +481,15 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Deploy virtual images
with
act
.
sub_activity
(
'deploying_disks'
):
devnums
=
list
(
string
.
lowercase
)
# a-z
for
disk
in
self
.
disks
.
all
():
# assign device numbers
if
disk
.
dev_num
in
devnums
:
devnums
.
remove
(
disk
.
dev_num
)
else
:
disk
.
dev_num
=
devnums
.
pop
(
0
)
disk
.
save
()
# deploy disk
disk
.
deploy
()
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
...
...
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