Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
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
9403e818
authored
Mar 05, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: add number to mass-created VMs' name
parent
cc595a39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
circle/vm/models/instance.py
+10
-3
No files found.
circle/vm/models/instance.py
View file @
9403e818
...
...
@@ -355,9 +355,16 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
params
=
dict
(
template
=
template
,
owner
=
owner
,
pw
=
pwgen
())
params
.
update
([(
f
,
getattr
(
template
,
f
))
for
f
in
common_fields
])
params
.
update
(
kwargs
)
# override defaults w/ user supplied values
return
[
cls
.
__create_instance
(
params
,
disks
,
networks
,
req_traits
,
tags
)
for
i
in
xrange
(
amount
)]
if
'
%
d'
not
in
params
[
'name'
]:
params
[
'name'
]
+=
'
%
d'
instances
=
[]
for
i
in
xrange
(
amount
):
real_params
=
params
real_params
[
'name'
]
=
real_params
[
'name'
]
.
replace
(
'
%
d'
,
str
(
i
))
instances
.
append
(
cls
.
__create_instance
(
real_params
,
disks
,
networks
,
req_traits
,
tags
))
return
instances
@classmethod
def
__create_instance
(
cls
,
params
,
disks
,
networks
,
req_traits
,
tags
):
...
...
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