Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
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
71162da5
authored
Jul 24, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs
parent
8b5c4576
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
circle/storage/models.py
+1
-0
circle/vm/models/instance.py
+1
-1
circle/vm/operations.py
+7
-2
No files found.
circle/storage/models.py
View file @
71162da5
...
@@ -496,6 +496,7 @@ class Disk(TimeStampedModel):
...
@@ -496,6 +496,7 @@ class Disk(TimeStampedModel):
disk
.
type
=
result
[
'type'
]
disk
.
type
=
result
[
'type'
]
disk
.
checksum
=
result
[
'checksum'
]
disk
.
checksum
=
result
[
'checksum'
]
disk
.
is_ready
=
True
disk
.
is_ready
=
True
disk
.
ci_disk
=
False
disk
.
save
()
disk
.
save
()
return
disk
return
disk
...
...
circle/vm/models/instance.py
View file @
71162da5
...
@@ -372,7 +372,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
...
@@ -372,7 +372,7 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
@property
@property
def
get_meta_data
(
self
):
def
get_meta_data
(
self
):
data
=
str
(
self
.
ci_
user
_data
)
.
replace
(
'{{hostname}}'
,
self
.
short_hostname
)
data
=
str
(
self
.
ci_
meta
_data
)
.
replace
(
'{{hostname}}'
,
self
.
short_hostname
)
return
data
return
data
def
_update_status
(
self
):
def
_update_status
(
self
):
...
...
circle/vm/operations.py
View file @
71162da5
...
@@ -435,7 +435,7 @@ class DeployOperation(InstanceOperation):
...
@@ -435,7 +435,7 @@ class DeployOperation(InstanceOperation):
self
.
instance
.
save
()
self
.
instance
.
save
()
else
:
else
:
self
.
instance
.
allocate_node
()
self
.
instance
.
allocate_node
()
logger
.
debug
(
' - - valami - - '
)
init_disk
=
None
init_disk
=
None
try
:
try
:
init_disk
=
self
.
instance
.
disks
.
get
(
ci_disk
=
True
)
init_disk
=
self
.
instance
.
disks
.
get
(
ci_disk
=
True
)
...
@@ -505,6 +505,10 @@ class DeployOperation(InstanceOperation):
...
@@ -505,6 +505,10 @@ class DeployOperation(InstanceOperation):
disk
.
full_clean
()
disk
.
full_clean
()
disk
.
save
()
disk
.
save
()
self
.
instance
.
disks
.
add
(
disk
)
self
.
instance
.
disks
.
add
(
disk
)
return
create_readable
(
ugettext_noop
(
" ---- META-DATA ----
\n
%(meta_data)
s
\n\n
---- USER-DATA ----
\n
%(user_data)
s"
),
meta_data
=
self
.
instance
.
get_meta_data
,
user_data
=
self
.
instance
.
get_user_data
)
@register_operation
@register_operation
class
DeployDisksOperation
(
SubOperationMixin
,
InstanceOperation
):
class
DeployDisksOperation
(
SubOperationMixin
,
InstanceOperation
):
...
@@ -843,7 +847,7 @@ class SaveAsTemplateOperation(InstanceOperation):
...
@@ -843,7 +847,7 @@ class SaveAsTemplateOperation(InstanceOperation):
'ci_meta_data'
:
self
.
instance
.
ci_meta_data
,
'ci_meta_data'
:
self
.
instance
.
ci_meta_data
,
'ci_user_data'
:
self
.
instance
.
ci_user_data
,
'ci_user_data'
:
self
.
instance
.
ci_user_data
,
}
}
print
(
params
)
params
.
update
(
kwargs
)
params
.
update
(
kwargs
)
params
.
pop
(
"parent_activity"
,
None
)
params
.
pop
(
"parent_activity"
,
None
)
...
@@ -857,6 +861,7 @@ class SaveAsTemplateOperation(InstanceOperation):
...
@@ -857,6 +861,7 @@ class SaveAsTemplateOperation(InstanceOperation):
self
.
disks
=
[]
self
.
disks
=
[]
for
disk
in
self
.
instance
.
disks
.
all
():
for
disk
in
self
.
instance
.
disks
.
all
():
if
disk
.
ci_disk
==
False
:
with
activity
.
sub_activity
(
with
activity
.
sub_activity
(
'saving_disk'
,
'saving_disk'
,
readable_name
=
create_readable
(
readable_name
=
create_readable
(
...
...
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