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
d31bb288
authored
Mar 13, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skeleton of save as template operation
parent
63501e0a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
150 additions
and
216 deletions
+150
-216
.idea/workspace.xml
+113
-99
circle/dashboard/views/vm.py
+20
-20
circle/vm/operations.py
+17
-97
No files found.
.idea/workspace.xml
View file @
d31bb288
...
@@ -3,9 +3,8 @@
...
@@ -3,9 +3,8 @@
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"1fbec8af-5a7c-40f9-b994-83ac07d1ae1d"
name=
"Default"
comment=
""
>
<list
default=
"true"
id=
"1fbec8af-5a7c-40f9-b994-83ac07d1ae1d"
name=
"Default"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
afterPath=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/views/util.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/views/util.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/vm/operations.py"
afterPath=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
</list>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"TRACKING_ENABLED"
value=
"true"
/>
<option
name=
"TRACKING_ENABLED"
value=
"true"
/>
...
@@ -31,23 +30,46 @@
...
@@ -31,23 +30,46 @@
</component>
</component>
<component
name=
"FileEditorManager"
>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
leaf-file-name=
"network.html"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"vm.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"264"
>
<caret
line=
"537"
column=
"31"
lean-forward=
"true"
selection-start-line=
"537"
selection-start-column=
"31"
selection-end-line=
"537"
selection-end-column=
"31"
/>
<folding>
<element
signature=
"e#41548#42719#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"operations.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
289
"
>
<state
relative-caret-position=
"
318
"
>
<caret
line=
"
17"
column=
"32"
lean-forward=
"false"
selection-start-line=
"17"
selection-start-column=
"28"
selection-end-line=
"17"
selection-end-column=
"32
"
/>
<caret
line=
"
501"
column=
"49"
lean-forward=
"true"
selection-start-line=
"501"
selection-start-column=
"49"
selection-end-line=
"501"
selection-end-column=
"49
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"vm.py"
pinned=
"false"
current-in-tab=
"true"
>
<file
leaf-file-name=
"urls.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"423"
>
<caret
line=
"226"
column=
"22"
lean-forward=
"false"
selection-start-line=
"226"
selection-start-column=
"22"
selection-end-line=
"226"
selection-end-column=
"22"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"template.py"
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/template.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
416
"
>
<state
relative-caret-position=
"
369
"
>
<caret
line=
"
156"
column=
"80"
lean-forward=
"false"
selection-start-line=
"156"
selection-start-column=
"80"
selection-end-line=
"156"
selection-end-column=
"80
"
/>
<caret
line=
"
69"
column=
"45"
lean-forward=
"false"
selection-start-line=
"69"
selection-start-column=
"45"
selection-end-line=
"69"
selection-end-column=
"45
"
/>
<folding>
<folding>
<element
signature=
"e#41570#42741#0"
expanded=
"false"
/>
<element
signature=
"e#731#787#0"
expanded=
"true"
/>
<marker
date=
"1520947233801"
expanded=
"true"
signature=
"9976:10189"
ph=
"SELECT count... vm_instance"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
...
@@ -65,14 +87,6 @@
...
@@ -65,14 +87,6 @@
</component>
</component>
<component
name=
"FindInProjectRecents"
>
<component
name=
"FindInProjectRecents"
>
<findStrings>
<findStrings>
<find>
polic
</find>
<find>
addinterfa
</find>
<find>
interface
</find>
<find>
os_
</find>
<find>
instanceoper
</find>
<find>
Vxlan.list
</find>
<find>
instanceoperat
</find>
<find>
operatedmixin
</find>
<find>
dashboard.views.vm-activity-list
</find>
<find>
dashboard.views.vm-activity-list
</find>
<find>
op.get
</find>
<find>
op.get
</find>
<find>
request.views.request-resource
</find>
<find>
request.views.request-resource
</find>
...
@@ -86,7 +100,6 @@
...
@@ -86,7 +100,6 @@
<find>
get_from_os
</find>
<find>
get_from_os
</find>
<find>
OperationView(
</find>
<find>
OperationView(
</find>
<find>
get_abl
</find>
<find>
get_abl
</find>
<find>
shutoff
</find>
<find>
vmaddinter
</find>
<find>
vmaddinter
</find>
<find>
addinterface
</find>
<find>
addinterface
</find>
<find>
shut
</find>
<find>
shut
</find>
...
@@ -95,6 +108,15 @@
...
@@ -95,6 +108,15 @@
<find>
get_object
</find>
<find>
get_object
</find>
<find>
class server
</find>
<find>
class server
</find>
<find>
vmdetail
</find>
<find>
vmdetail
</find>
<find>
policy
</find>
<find>
vm_ops
</find>
<find>
VmSaveView
</find>
<find>
saveaste
</find>
<find>
shutoff
</find>
<find>
compute:
</find>
<find>
wtf
</find>
<find>
True
</find>
<find>
template
</find>
</findStrings>
</findStrings>
<replaceStrings>
<replaceStrings>
<replace>
'ACTIVE'
</replace>
<replace>
'ACTIVE'
</replace>
...
@@ -112,7 +134,6 @@
...
@@ -112,7 +134,6 @@
<component
name=
"IdeDocumentHistory"
>
<component
name=
"IdeDocumentHistory"
>
<option
name=
"CHANGED_PATHS"
>
<option
name=
"CHANGED_PATHS"
>
<list>
<list>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-create-2.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-create-1.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/_vm-create-1.html"
/>
<option
value=
"$PROJECT_DIR$/circle/openstack_api/__init__.py"
/>
<option
value=
"$PROJECT_DIR$/circle/openstack_api/__init__.py"
/>
<option
value=
"$PROJECT_DIR$/circle/openstack_api/neutron.py"
/>
<option
value=
"$PROJECT_DIR$/circle/openstack_api/neutron.py"
/>
...
@@ -137,7 +158,6 @@
...
@@ -137,7 +158,6 @@
<option
value=
"$PROJECT_DIR$/circle/network/static/js/horizon.flatnetworktopology.js"
/>
<option
value=
"$PROJECT_DIR$/circle/network/static/js/horizon.flatnetworktopology.js"
/>
<option
value=
"$PROJECT_DIR$/circle/network/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/editor.html"
/>
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/editor.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/user.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/user.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/base.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/base.html"
/>
<option
value=
"$PROJECT_DIR$/circle/bower.json"
/>
<option
value=
"$PROJECT_DIR$/circle/bower.json"
/>
...
@@ -158,11 +178,13 @@
...
@@ -158,11 +178,13 @@
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/console.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/console.html"
/>
<option
value=
"$PROJECT_DIR$/circle/common/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/common/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/forms.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/forms.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/util.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/util.py"
/>
<option
value=
"$PROJECT_DIR$/circle/openstack_api/nova.py"
/>
<option
value=
"$PROJECT_DIR$/circle/openstack_api/nova.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/template.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/urls.py"
/>
</list>
</list>
</option>
</option>
</component>
</component>
...
@@ -235,14 +257,7 @@
...
@@ -235,14 +257,7 @@
<path>
<path>
<item
name=
"cloud"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"cloud"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"requirements"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"common"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"cloud"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"openstack_api"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</path>
</expand>
</expand>
<select
/>
<select
/>
...
@@ -258,7 +273,7 @@
...
@@ -258,7 +273,7 @@
<property
name=
"settings.editor.selected.configurable"
value=
"watcher.settings"
/>
<property
name=
"settings.editor.selected.configurable"
value=
"watcher.settings"
/>
<property
name=
"NewWatcherDialog.advanced.open"
value=
"true"
/>
<property
name=
"NewWatcherDialog.advanced.open"
value=
"true"
/>
<property
name=
"DefaultHtmlFileTemplate"
value=
"HTML File"
/>
<property
name=
"DefaultHtmlFileTemplate"
value=
"HTML File"
/>
<property
name=
"SearchEverywhereHistoryKey"
value=
"
base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py vmadd	null	null vmdetail	null	null addinterfa	null	null addin	null	null server	null	null Instance	null	null instance	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py operat	null	null ins	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py operations	FILE	file:///home/h3yduck/cloud/circle/common/operations.py vmdetai	null	null index	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html operationvi	null	null ser	null	null server.	FILE	file:///home/h3yduck/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/v2/servers.py resources.	FILE	file:///home/h3yduck/cloud/circle/request/templates/request/initials/resources.html vm-de	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html vxla	null	null urls	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py index-v	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html index-vm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html opera	null	null vmdeta	null	null create	FILE	file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html vxl	null	null nov	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py nova.p	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py vmdetailv	null	null editor	null	null networktopo	FILE	file:///home/h3yduck/cloud/circle/network/static/js/horizon.networktopology.js bow	FILE	file:///home/h3yduck/cloud/circle/bower.json base.py	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py local	null	null vnc	null	null plain	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-plain-image-create.html forms	null	null vxlanform	null	null instanc	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py index-vxla	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html _vm-c	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/_vm-create-1.html vmcrea	null	null loginV	null	null index.html	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html sleep	null	null Deploy	null	null Vmdeta	null	null list_from	null	null aclupda	null	null base.htm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/base.htm
l"
/>
<property
name=
"SearchEverywhereHistoryKey"
value=
"
opera	FILE	file:///home/h3yduck/cloud/circle/vm/operations.py operations	FILE	file:///home/h3yduck/cloud/circle/common/operations.py templat	null	null base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py vmadd	null	null vmdetail	null	null addinterfa	null	null addin	null	null server	null	null Instance	null	null instance	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py operat	null	null ins	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py vmdetai	null	null index	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html operationvi	null	null ser	null	null server.	FILE	file:///home/h3yduck/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/v2/servers.py resources.	FILE	file:///home/h3yduck/cloud/circle/request/templates/request/initials/resources.html vm-de	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html vxla	null	null urls	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py index-v	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html index-vm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html vmdeta	null	null create	FILE	file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html vxl	null	null nov	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py nova.p	FILE	file:///home/h3yduck/cloud/circle/openstack_api/nova.py vmdetailv	null	null editor	null	null networktopo	FILE	file:///home/h3yduck/cloud/circle/network/static/js/horizon.networktopology.js bow	FILE	file:///home/h3yduck/cloud/circle/bower.json base.py	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py local	null	null vnc	null	null plain	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-plain-image-create.html forms	null	null vxlanform	null	null instanc	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py index-vxla	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html _vm-c	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/_vm-create-1.html vmcrea	null	null loginV	null	null index.html	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html sleep	null	null Deploy	null	null Vmdeta	null	null list_from	null	nul
l"
/>
</component>
</component>
<component
name=
"RecentsManager"
>
<component
name=
"RecentsManager"
>
<key
name=
"MoveFile.RECENT_KEYS"
>
<key
name=
"MoveFile.RECENT_KEYS"
>
...
@@ -378,14 +393,14 @@
...
@@ -378,14 +393,14 @@
</component>
</component>
<component
name=
"ToolWindowManager"
>
<component
name=
"ToolWindowManager"
>
<frame
x=
"-2"
y=
"-1"
width=
"1924"
height=
"1063"
extended-state=
"0"
/>
<frame
x=
"-2"
y=
"-1"
width=
"1924"
height=
"1063"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<layout>
<layout>
<window_info
id=
"TODO"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32980973"
sideWeight=
"0.4978701"
order=
"6"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"TODO"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32980973"
sideWeight=
"0.4978701"
order=
"6"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Messages"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.327818"
sideWeight=
"0.5021299"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Event Log"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.327818"
sideWeight=
"0.5021299"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32
80757
"
sideWeight=
"0.5234139"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32
769555
"
sideWeight=
"0.5234139"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Python Console"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.43023255"
sideWeight=
"0.43610224"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Python Console"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.43023255"
sideWeight=
"0.43610224"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32769555"
sideWeight=
"0.49574015"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32769555"
sideWeight=
"0.49574015"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.
391120
5"
sideWeight=
"0.48988286"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.
711416
5"
sideWeight=
"0.48988286"
order=
"7"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.18051118"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.18051118"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Docker"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"8"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Docker"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"false"
weight=
"0.33"
sideWeight=
"0.5"
order=
"8"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Database"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Database"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
...
@@ -393,9 +408,8 @@
...
@@ -393,9 +408,8 @@
<window_info
id=
"SciView"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"SciView"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"
false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"fals
e"
show_stripe_button=
"true"
weight=
"0.7114165"
sideWeight=
"0.5101172"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"
true"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"tru
e"
show_stripe_button=
"true"
weight=
"0.7114165"
sideWeight=
"0.5101172"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Messages"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Message"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Message"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.33"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Commander"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Commander"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"0"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Inspection"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"5"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Inspection"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"5"
side_tool=
"false"
content_ui=
"tabs"
/>
...
@@ -557,39 +571,6 @@
...
@@ -557,39 +571,6 @@
</expressions>
</expressions>
</component>
</component>
<component
name=
"editorHistoryManager"
>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/base.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"18"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"18"
selection-end-line=
"0"
selection-end-column=
"18"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/static/vue.css"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"0"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"0"
selection-end-line=
"0"
selection-end-column=
"0"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/base.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"272"
>
<caret
line=
"16"
column=
"20"
lean-forward=
"false"
selection-start-line=
"16"
selection-start-column=
"20"
selection-end-line=
"16"
selection-end-column=
"20"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"204"
>
<caret
line=
"12"
column=
"0"
lean-forward=
"false"
selection-start-line=
"12"
selection-start-column=
"0"
selection-end-line=
"12"
selection-end-column=
"0"
/>
<folding>
<element
signature=
"e#422#429#1#HTML"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/forms.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/network/forms.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"6273"
>
<state
relative-caret-position=
"6273"
>
...
@@ -850,14 +831,6 @@
...
@@ -850,14 +831,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-2636"
>
<caret
line=
"58"
column=
"36"
lean-forward=
"false"
selection-start-line=
"58"
selection-start-column=
"14"
selection-end-line=
"58"
selection-end-column=
"36"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/forms/models.py"
>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/forms/models.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"306"
>
<state
relative-caret-position=
"306"
>
...
@@ -898,16 +871,6 @@
...
@@ -898,16 +871,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"301"
>
<caret
line=
"189"
column=
"0"
lean-forward=
"false"
selection-start-line=
"189"
selection-start-column=
"0"
selection-end-line=
"189"
selection-end-column=
"0"
/>
<folding>
<element
signature=
"e#732#788#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py"
>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"256"
>
<state
relative-caret-position=
"256"
>
...
@@ -932,14 +895,6 @@
...
@@ -932,14 +895,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/common/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"454"
>
<caret
line=
"232"
column=
"0"
lean-forward=
"true"
selection-start-line=
"232"
selection-start-column=
"0"
selection-end-line=
"232"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/openstack_api/nova.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/openstack_api/nova.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"233"
>
<state
relative-caret-position=
"233"
>
...
@@ -956,6 +911,14 @@
...
@@ -956,6 +911,14 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/requirements/circlestack.txt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"173"
>
<caret
line=
"80"
column=
"11"
lean-forward=
"false"
selection-start-line=
"80"
selection-start-column=
"5"
selection-end-line=
"80"
selection-end-column=
"11"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"289"
>
<state
relative-caret-position=
"289"
>
...
@@ -964,12 +927,63 @@
...
@@ -964,12 +927,63 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/common/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"478"
>
<caret
line=
"232"
column=
"0"
lean-forward=
"true"
selection-start-line=
"232"
selection-start-column=
"0"
selection-end-line=
"232"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/django/core/checks/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"289"
>
<caret
line=
"55"
column=
"2"
lean-forward=
"false"
selection-start-line=
"55"
selection-start-column=
"2"
selection-end-line=
"55"
selection-end-column=
"2"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file:///usr/lib/python2.7/re.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"306"
>
<caret
line=
"142"
column=
"4"
lean-forward=
"false"
selection-start-line=
"142"
selection-start-column=
"4"
selection-end-line=
"142"
selection-end-column=
"4"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/operations.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"318"
>
<caret
line=
"501"
column=
"49"
lean-forward=
"true"
selection-start-line=
"501"
selection-start-column=
"49"
selection-end-line=
"501"
selection-end-column=
"49"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"416"
>
<state
relative-caret-position=
"264"
>
<caret
line=
"156"
column=
"80"
lean-forward=
"false"
selection-start-line=
"156"
selection-start-column=
"80"
selection-end-line=
"156"
selection-end-column=
"80"
/>
<caret
line=
"537"
column=
"31"
lean-forward=
"true"
selection-start-line=
"537"
selection-start-column=
"31"
selection-end-line=
"537"
selection-end-column=
"31"
/>
<folding>
<element
signature=
"e#41548#42719#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"423"
>
<caret
line=
"226"
column=
"22"
lean-forward=
"false"
selection-start-line=
"226"
selection-start-column=
"22"
selection-end-line=
"226"
selection-end-column=
"22"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/template.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"369"
>
<caret
line=
"69"
column=
"45"
lean-forward=
"false"
selection-start-line=
"69"
selection-start-column=
"45"
selection-end-line=
"69"
selection-end-column=
"45"
/>
<folding>
<folding>
<element
signature=
"e#41570#42741#0"
expanded=
"false"
/>
<element
signature=
"e#731#787#0"
expanded=
"true"
/>
<marker
date=
"1520947233801"
expanded=
"true"
signature=
"9976:10189"
ph=
"SELECT count... vm_instance"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
...
...
circle/dashboard/views/vm.py
View file @
d31bb288
...
@@ -62,7 +62,7 @@ from .util import (
...
@@ -62,7 +62,7 @@ from .util import (
)
)
from
..forms
import
(
from
..forms
import
(
AclUserOrGroupAddForm
,
VmResourcesForm
,
VmCustomizeForm
,
VmDeployForm
,
VmFromPlainImageForm
,
VmRemoveInterfaceForm
,
AclUserOrGroupAddForm
,
VmResourcesForm
,
VmCustomizeForm
,
VmDeployForm
,
VmFromPlainImageForm
,
VmRemoveInterfaceForm
,
VmAddInterfaceForm
)
VmAddInterfaceForm
,
VmSaveForm
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -523,24 +523,24 @@ class VmAddInterfaceView(FormOperationMixin, VmOperationView):
...
@@ -523,24 +523,24 @@ class VmAddInterfaceView(FormOperationMixin, VmOperationView):
# return val
# return val
#
#
#
#
#
class VmSaveView(FormOperationMixin, VmOperationView):
class
VmSaveView
(
FormOperationMixin
,
VmOperationView
):
#
#
op = 'save_as_template'
op
=
'save_as_template'
#
icon = 'save'
icon
=
'save'
#
effect = 'info'
effect
=
'info'
#
form_class = VmSaveForm
form_class
=
VmSaveForm
#
#
def get_form_kwargs(self):
def
get_form_kwargs
(
self
):
# op = self.get_op
()
context
=
super
(
VmSaveView
,
self
)
.
get_form_kwargs
()
# val = super(VmSaveView, self).get_form_kwargs
()
op
=
self
.
get_op
()
# val['default'] = op._rename(op.instance.name)
# obj = self.get_object(
)
context
[
'default'
]
=
op
.
_rename
(
op
.
instance
.
name
)
# if obj.template and obj.template.has_level(
obj
=
self
.
get_object
()
# self.request.user, "owner"):
# val['clone'] = True
#context['clone'] = True #TODO: if instance has a template already this option allows clone of permissions
# return val
return
context
#
#
# class VmResourcesChangeView(VmOperationView):
# class VmResourcesChangeView(VmOperationView):
# op = 'resources_change'
# op = 'resources_change'
# icon = "save"
# icon = "save"
...
@@ -761,7 +761,7 @@ vm_ops = OrderedDict([
...
@@ -761,7 +761,7 @@ vm_ops = OrderedDict([
(
'sleep'
,
VmOperationView
.
factory
(
(
'sleep'
,
VmOperationView
.
factory
(
op
=
'sleep'
,
icon
=
'moon-o'
,
effect
=
'info'
)),
op
=
'sleep'
,
icon
=
'moon-o'
,
effect
=
'info'
)),
# ('migrate', VmMigrateView),
# ('migrate', VmMigrateView),
#
('save_as_template', VmSaveView),
(
'save_as_template'
,
VmSaveView
),
(
'reboot'
,
VmOperationView
.
factory
(
(
'reboot'
,
VmOperationView
.
factory
(
op
=
'reboot'
,
icon
=
'refresh'
,
effect
=
'warning'
)),
op
=
'reboot'
,
icon
=
'refresh'
,
effect
=
'warning'
)),
# ('reset', VmOperationView.factory(
# ('reset', VmOperationView.factory(
...
...
circle/vm/operations.py
View file @
d31bb288
...
@@ -124,16 +124,17 @@ class InstanceOperation(Operation):
...
@@ -124,16 +124,17 @@ class InstanceOperation(Operation):
raise
self
.
instance
.
WrongStateError
(
self
.
instance
)
raise
self
.
instance
.
WrongStateError
(
self
.
instance
)
def
check_auth
(
self
,
user
,
request
):
def
check_auth
(
self
,
user
,
request
):
from
django.utils.module_loading
import
import_string
if
self
.
os_policy_actions
:
check
=
import_string
(
"openstack_auth.policy.check"
)
from
django.utils.module_loading
import
import_string
check
=
import_string
(
"openstack_auth.policy.check"
)
has_rights
=
check
(
self
.
os_policy_actions
,
request
,
has_rights
=
check
(
self
.
os_policy_actions
,
request
,
{
'project_id'
:
self
.
instance
.
tenant_id
})
{
'project_id'
:
self
.
instance
.
tenant_id
})
if
not
has_rights
:
if
not
has_rights
:
raise
humanize_exception
(
ugettext_noop
(
raise
humanize_exception
(
ugettext_noop
(
"operation not permitted"
),
"operation not permitted"
),
PermissionDenied
())
PermissionDenied
())
super
(
InstanceOperation
,
self
)
.
check_auth
(
user
=
user
)
super
(
InstanceOperation
,
self
)
.
check_auth
(
user
=
user
)
...
@@ -505,15 +506,8 @@ class SaveAsTemplateOperation(InstanceOperation):
...
@@ -505,15 +506,8 @@ class SaveAsTemplateOperation(InstanceOperation):
"with users and groups. Anyone who has access to a "
"with users and groups. Anyone who has access to a "
"template (and to the networks it uses) will be able to "
"template (and to the networks it uses) will be able to "
"start an instance of it."
)
"start an instance of it."
)
has_percentage
=
True
accept_states
=
(
'SHUTOFF'
,
'ACTIVE'
)
# TODO: try other states
abortable
=
True
# os_policy_actions = (("compute", "compute:stop"),)
required_perms
=
(
'vm.create_template'
,)
accept_states
=
(
'ACTIVE'
,
'STOPPED'
)
async_queue
=
"localhost.man.slow"
def
is_preferred
(
self
):
return
(
self
.
instance
.
is_base
and
self
.
instance
.
status
==
self
.
instance
.
STATUS
.
RUNNING
)
@staticmethod
@staticmethod
def
_rename
(
name
):
def
_rename
(
name
):
...
@@ -525,87 +519,13 @@ class SaveAsTemplateOperation(InstanceOperation):
...
@@ -525,87 +519,13 @@ class SaveAsTemplateOperation(InstanceOperation):
v
=
1
v
=
1
return
"
%
s v
%
d"
%
(
name
,
v
)
return
"
%
s v
%
d"
%
(
name
,
v
)
def
on_abort
(
self
,
activity
,
error
):
def
_operation
(
self
,
request
,
user
,
system
,
name
=
None
,
if
hasattr
(
self
,
'disks'
):
for
disk
in
self
.
disks
:
disk
.
destroy
()
def
_operation
(
self
,
activity
,
user
,
system
,
name
=
None
,
with_shutdown
=
True
,
clone
=
False
,
task
=
None
,
**
kwargs
):
with_shutdown
=
True
,
clone
=
False
,
task
=
None
,
**
kwargs
):
try
:
print
"TODO: create template"
self
.
instance
.
_cleanup
(
parent_activity
=
activity
,
user
=
user
)
# return create_readable(
except
:
# ugettext_noop("New template: %(template)s"),
pass
# template=reverse('dashboard.views.template-detail',
# kwargs={'pk': 0}))
if
with_shutdown
:
try
:
self
.
instance
.
shutdown
(
parent_activity
=
activity
,
user
=
user
,
task
=
task
)
except
Instance
.
WrongStateError
:
pass
# prepare parameters
params
=
{
'access_method'
:
self
.
instance
.
access_method
,
'arch'
:
self
.
instance
.
arch
,
'boot_menu'
:
self
.
instance
.
boot_menu
,
'description'
:
self
.
instance
.
description
,
'lease'
:
self
.
instance
.
lease
,
# Can be problem in new VM
'max_ram_size'
:
self
.
instance
.
max_ram_size
,
'name'
:
name
or
self
.
_rename
(
self
.
instance
.
name
),
'num_cores'
:
self
.
instance
.
num_cores
,
'owner'
:
user
,
'parent'
:
self
.
instance
.
template
or
None
,
# Can be problem
'priority'
:
self
.
instance
.
priority
,
'ram_size'
:
self
.
instance
.
ram_size
,
'raw_data'
:
self
.
instance
.
raw_data
,
'system'
:
self
.
instance
.
system
,
}
params
.
update
(
kwargs
)
params
.
pop
(
"parent_activity"
,
None
)
from
storage.models
import
Disk
def
__try_save_disk
(
disk
):
try
:
return
disk
.
save_as
(
task
)
except
Disk
.
WrongDiskTypeError
:
return
disk
self
.
disks
=
[]
for
disk
in
self
.
instance
.
disks
.
all
():
with
activity
.
sub_activity
(
'saving_disk'
,
readable_name
=
create_readable
(
ugettext_noop
(
"saving disk
%(name)
s"
),
name
=
disk
.
name
)
):
self
.
disks
.
append
(
__try_save_disk
(
disk
))
# create template and do additional setup
tmpl
=
InstanceTemplate
(
**
params
)
tmpl
.
full_clean
()
# Avoiding database errors.
tmpl
.
save
()
# Copy traits from the VM instance
tmpl
.
req_traits
.
add
(
*
self
.
instance
.
req_traits
.
all
())
if
clone
:
tmpl
.
clone_acl
(
self
.
instance
.
template
)
# Add permission for the original owner of the template
tmpl
.
set_level
(
self
.
instance
.
template
.
owner
,
'owner'
)
tmpl
.
set_level
(
user
,
'owner'
)
try
:
tmpl
.
disks
.
add
(
*
self
.
disks
)
# create interface templates
for
i
in
self
.
instance
.
interface_set
.
all
():
i
.
save_as_template
(
tmpl
)
except
:
tmpl
.
delete
()
raise
else
:
return
create_readable
(
ugettext_noop
(
"New template:
%(template)
s"
),
template
=
reverse
(
'dashboard.views.template-detail'
,
kwargs
=
{
'pk'
:
tmpl
.
pk
}))
@register_operation
@register_operation
...
...
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