Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
fd294c27
authored
Jun 17, 2018
by
Szabolcs Gelencser
Committed by
Szabolcs Gelencsér
Jun 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add image sharing compatibility for mitaka
parent
ce649c0d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
3 deletions
+8
-3
circle/dashboard/views/template.py
+1
-1
circle/dashboard/views/util.py
+1
-1
circle/vm/models/instance.py
+5
-0
circle/vm/operations.py
+1
-1
No files found.
circle/dashboard/views/template.py
View file @
fd294c27
...
...
@@ -343,7 +343,7 @@ class TemplateDetail(LoginRequiredMixin, GraphMixin, SuccessMessageMixin, Update
def
get_context_data
(
self
,
**
kwargs
):
template
=
self
.
get_object
()
openstack_api
.
glance
.
image_update
(
self
.
request
,
template
.
image_id
,
visibility
=
"shared"
)
template
.
make_it_shared
(
self
.
request
)
context
=
super
(
TemplateDetail
,
self
)
.
get_context_data
(
**
kwargs
)
# context['acl'] = AclUpdateView.get_acl_data(
# template, self.request.user, 'dashboard.views.template-acl')
...
...
circle/dashboard/views/util.py
View file @
fd294c27
...
...
@@ -595,7 +595,7 @@ class AclUpdateView(LoginRequiredMixin, View, SingleObjectMixin):
self
.
template
=
self
.
get_object
()
self
.
glance
=
self
.
__get_glance_admin_client
(
self
.
request
.
user
.
tenant_id
)
openstack_api
.
glance
.
image_update
(
request
,
self
.
template
.
image_id
,
visibility
=
"shared"
)
self
.
template
.
make_it_shared
(
request
)
self
.
__handle_removes_from_db
()
self
.
__handle_assignments
()
self
.
__cleanup_assigned_members_of_snapshot
()
...
...
circle/vm/models/instance.py
View file @
fd294c27
...
...
@@ -215,6 +215,11 @@ class InstanceTemplate(TimeStampedModel):
# TODO: what is this?
return
'template.
%
d'
%
self
.
pk
def
make_it_shared
(
self
,
request
):
try
:
openstack_api
.
glance
.
image_update
(
request
,
self
.
image_id
,
visibility
=
"shared"
)
except
:
pass
# prior API 2.5 image became shared by adding members
class
Instance
(
OperatedMixin
,
TimeStampedModel
):
"""Virtual machine instance.
...
...
circle/vm/operations.py
View file @
fd294c27
...
...
@@ -531,7 +531,7 @@ class SaveAsTemplateOperation(InstanceOperation):
with_shutdown
=
True
,
clone
=
False
,
task
=
None
,
**
kwargs
):
template_image_id
=
openstack_api
.
nova
.
snapshot_create
(
request
,
self
.
instance
.
id
,
name
)
openstack_api
.
glance
.
image_update
(
request
,
template_image_id
,
visibility
=
"shared"
)
template
.
make_it_shared
(
request
)
template
=
InstanceTemplate
(
name
=
name
,
image_id
=
template_image_id
,
...
...
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