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
cb5e6c89
authored
Mar 13, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add vm creation from template
parent
3199d66f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
137 additions
and
127 deletions
+137
-127
.idea/workspace.xml
+101
-109
circle/dashboard/templatetags/instance_tags.py
+7
-2
circle/dashboard/views/vm.py
+29
-16
No files found.
.idea/workspace.xml
View file @
cb5e6c89
...
@@ -3,12 +3,8 @@
...
@@ -3,12 +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/index-templates.html"
afterPath=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-templates.html"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/templatetags/instance_tags.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/templatetags/instance_tags.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html"
afterPath=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/urls.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/urls.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/views/index.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/views/index.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/dashboard/views/template.py"
afterPath=
"$PROJECT_DIR$/circle/dashboard/views/template.py"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/vm/models/instance.py"
afterPath=
"$PROJECT_DIR$/circle/vm/models/instance.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"
/>
...
@@ -34,41 +30,51 @@
...
@@ -34,41 +30,51 @@
</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=
"
index.html"
pinned=
"false"
current-in-tab=
"fals
e"
>
<file
leaf-file-name=
"
vm.py"
pinned=
"false"
current-in-tab=
"tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
templates/dashboard/index.html
"
>
<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=
"
437
"
>
<state
relative-caret-position=
"
568
"
>
<caret
line=
"
35"
column=
"36"
lean-forward=
"true"
selection-start-line=
"35"
selection-start-column=
"36"
selection-end-line=
"35"
selection-end-column=
"36
"
/>
<caret
line=
"
1139"
column=
"19"
lean-forward=
"false"
selection-start-line=
"1139"
selection-start-column=
"19"
selection-end-line=
"1139"
selection-end-column=
"19
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"
index-templates.html
"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"
client.py
"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$
PROJECT_DIR$/circle/dashboard/templates/dashboard/index-templates.html
"
>
<entry
file=
"file://$
USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/client.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2
67
"
>
<state
relative-caret-position=
"2
33
"
>
<caret
line=
"
24"
column=
"17"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"17"
selection-end-line=
"24"
selection-end-column=
"17
"
/>
<caret
line=
"
82"
column=
"0"
lean-forward=
"false"
selection-start-line=
"82"
selection-start-column=
"0"
selection-end-line=
"82"
selection-end-column=
"0
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"in
dex
.py"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"in
stance_tags
.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
views/index
.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
templatetags/instance_tags
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
102
"
>
<state
relative-caret-position=
"
575
"
>
<caret
line=
"
62"
column=
"23"
lean-forward=
"true"
selection-start-line=
"62"
selection-start-column=
"23"
selection-end-line=
"62"
selection-end-column=
"2
3"
/>
<caret
line=
"
36"
column=
"43"
lean-forward=
"true"
selection-start-line=
"36"
selection-start-column=
"43"
selection-end-line=
"36"
selection-end-column=
"4
3"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"
urls.py"
pinned=
"false"
current-in-tab=
"tru
e"
>
<file
leaf-file-name=
"
operations.py"
pinned=
"false"
current-in-tab=
"fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
dashboard/url
s.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
common/operation
s.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"267"
>
<state
relative-caret-position=
"429"
>
<caret
line=
"50"
column=
"45"
lean-forward=
"true"
selection-start-line=
"50"
selection-start-column=
"45"
selection-end-line=
"50"
selection-end-column=
"45"
/>
<caret
line=
"242"
column=
"0"
lean-forward=
"false"
selection-start-line=
"242"
selection-start-column=
"0"
selection-end-line=
"242"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"nova.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/openstack_api/nova.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"225"
>
<caret
line=
"310"
column=
"0"
lean-forward=
"false"
selection-start-line=
"310"
selection-start-column=
"0"
selection-end-line=
"310"
selection-end-column=
"0"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
@@ -86,10 +92,6 @@
...
@@ -86,10 +92,6 @@
</component>
</component>
<component
name=
"FindInProjectRecents"
>
<component
name=
"FindInProjectRecents"
>
<findStrings>
<findStrings>
<find>
get_status_icon
</find>
<find>
icon
</find>
<find>
_(
</find>
<find>
system
</find>
<find>
instan
</find>
<find>
instan
</find>
<find>
monkey
</find>
<find>
monkey
</find>
<find>
_os_server
</find>
<find>
_os_server
</find>
...
@@ -116,6 +118,10 @@
...
@@ -116,6 +118,10 @@
<find>
saveas
</find>
<find>
saveas
</find>
<find>
save
</find>
<find>
save
</find>
<find>
template-list
</find>
<find>
template-list
</find>
<find>
openstack_api.nova.server_create
</find>
<find>
class instancetemplate
</find>
<find>
reverse
</find>
<find>
vmcreate
</find>
</findStrings>
</findStrings>
<replaceStrings>
<replaceStrings>
<replace>
'ACTIVE'
</replace>
<replace>
'ACTIVE'
</replace>
...
@@ -166,7 +172,6 @@
...
@@ -166,7 +172,6 @@
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/resources.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/resources.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templatetags/instance_tags.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html"
/>
<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"
/>
...
@@ -174,7 +179,6 @@
...
@@ -174,7 +179,6 @@
<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/vm.py"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/settings/base.py"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/settings/base.py"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
...
@@ -184,6 +188,8 @@
...
@@ -184,6 +188,8 @@
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-templates.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-templates.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/index.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/index.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templatetags/instance_tags.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
</list>
</list>
</option>
</option>
</component>
</component>
...
@@ -264,15 +270,7 @@
...
@@ -264,15 +270,7 @@
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"dashboard"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"dashboard"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"templates"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"templatetags"
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=
"dashboard"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"templates"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"dashboard"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</path>
<path>
<path>
<item
name=
"cloud"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"cloud"
type=
"b2602c69:ProjectViewProjectNode"
/>
...
@@ -293,7 +291,7 @@
...
@@ -293,7 +291,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=
"
	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py url	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py instancetem	null	null
vmcreate	null	null index	FILE	file:///home/h3yduck/cloud/circle/dashboard/views/index.py base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py opera	FILE	file:///home/h3yduck/cloud/circle/vm/operations.py operations	FILE	file:///home/h3yduck/cloud/circle/common/operations.py templat	null	null 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 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"
/>
<property
name=
"SearchEverywhereHistoryKey"
value=
"
instancetem	null	null url	FILE	file:///home/h3yduck/cloud/circle/dashboard/urls.py
vmcreate	null	null index	FILE	file:///home/h3yduck/cloud/circle/dashboard/views/index.py base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py opera	FILE	file:///home/h3yduck/cloud/circle/vm/operations.py operations	FILE	file:///home/h3yduck/cloud/circle/common/operations.py templat	null	null 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 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"
/>
</component>
</component>
<component
name=
"RecentsManager"
>
<component
name=
"RecentsManager"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
<key
name=
"CopyFile.RECENT_KEYS"
>
...
@@ -423,7 +421,7 @@
...
@@ -423,7 +421,7 @@
<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.32769555"
sideWeight=
"0.514377"
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.32769555"
sideWeight=
"0.514377"
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.
32769555"
sideWeight=
"0.485623
"
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.
7114165"
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"
/>
...
@@ -431,7 +429,7 @@
...
@@ -431,7 +429,7 @@
<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=
"true"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
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=
"true"
show_stripe_button=
"true"
weight=
"0.
23150106
"
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=
"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"
/>
...
@@ -514,7 +512,7 @@
...
@@ -514,7 +512,7 @@
</properties>
</properties>
</breakpoint>
</breakpoint>
</default-breakpoints>
</default-breakpoints>
<option
name=
"time"
value=
"23
4
"
/>
<option
name=
"time"
value=
"23
5
"
/>
</breakpoint-manager>
</breakpoint-manager>
<watches-manager
/>
<watches-manager
/>
</component>
</component>
...
@@ -606,24 +604,6 @@
...
@@ -606,24 +604,6 @@
</expressions>
</expressions>
</component>
</component>
<component
name=
"editorHistoryManager"
>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"831"
>
<caret
line=
"49"
column=
"25"
lean-forward=
"true"
selection-start-line=
"49"
selection-start-column=
"25"
selection-end-line=
"49"
selection-end-column=
"25"
/>
<folding>
<element
signature=
"e#732#773#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/__init__.py"
>
<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"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2/typing.pyi"
>
<entry
file=
"file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2/typing.pyi"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"195"
>
<state
relative-caret-position=
"195"
>
...
@@ -752,16 +732,6 @@
...
@@ -752,16 +732,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templatetags/instance_tags.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"391"
>
<caret
line=
"23"
column=
"29"
lean-forward=
"false"
selection-start-line=
"23"
selection-start-column=
"29"
selection-end-line=
"23"
selection-end-column=
"29"
/>
<folding>
<element
signature=
"e#0#35#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"374"
>
<state
relative-caret-position=
"374"
>
...
@@ -874,14 +844,6 @@
...
@@ -874,14 +844,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/openstack_api/nova.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"233"
>
<caret
line=
"129"
column=
"25"
lean-forward=
"true"
selection-start-line=
"129"
selection-start-column=
"25"
selection-end-line=
"129"
selection-end-column=
"25"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/requirements/circlestack.txt"
>
<entry
file=
"file://$PROJECT_DIR$/requirements/circlestack.txt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"173"
>
<state
relative-caret-position=
"173"
>
...
@@ -914,14 +876,6 @@
...
@@ -914,14 +876,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=
"-204"
>
<caret
line=
"28"
column=
"6"
lean-forward=
"false"
selection-start-line=
"28"
selection-start-column=
"6"
selection-end-line=
"28"
selection-end-column=
"6"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json"
>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/os_policies/circle_policy.json"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"51"
>
<state
relative-caret-position=
"51"
>
...
@@ -962,62 +916,100 @@
...
@@ -962,62 +916,100 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/instance.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/template.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"233"
>
<caret
line=
"43"
column=
"1"
lean-forward=
"true"
selection-start-line=
"43"
selection-start-column=
"1"
selection-end-line=
"43"
selection-end-column=
"1"
/>
<folding>
<marker
date=
"1520950390987"
expanded=
"true"
signature=
"9980:10193"
ph=
"SELECT count... vm_instance"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/index.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
235
"
>
<state
relative-caret-position=
"
102
"
>
<caret
line=
"
166"
column=
"28"
lean-forward=
"false"
selection-start-line=
"166"
selection-start-column=
"28"
selection-end-line=
"166"
selection-end-column=
"28
"
/>
<caret
line=
"
62"
column=
"23"
lean-forward=
"false"
selection-start-line=
"62"
selection-start-column=
"23"
selection-end-line=
"62"
selection-end-column=
"23
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
views/vm.py
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
templates/dashboard/index-templates.html
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"1094"
>
<state
relative-caret-position=
"267"
>
<caret
line=
"1124"
column=
"29"
lean-forward=
"false"
selection-start-line=
"1124"
selection-start-column=
"21"
selection-end-line=
"1124"
selection-end-column=
"29"
/>
<caret
line=
"24"
column=
"17"
lean-forward=
"false"
selection-start-line=
"24"
selection-start-column=
"17"
selection-end-line=
"24"
selection-end-column=
"17"
/>
<folding>
<folding
/>
<element
signature=
"e#41548#42719#0"
expanded=
"false"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"437"
>
<state
relative-caret-position=
"437"
>
<caret
line=
"35"
column=
"36"
lean-forward=
"
tru
e"
selection-start-line=
"35"
selection-start-column=
"36"
selection-end-line=
"35"
selection-end-column=
"36"
/>
<caret
line=
"35"
column=
"36"
lean-forward=
"
fals
e"
selection-start-line=
"35"
selection-start-column=
"36"
selection-end-line=
"35"
selection-end-column=
"36"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/template.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/instance.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"497"
>
<caret
line=
"145"
column=
"13"
lean-forward=
"false"
selection-start-line=
"145"
selection-start-column=
"4"
selection-end-line=
"145"
selection-end-column=
"13"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/activity.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"
>
<caret
line=
"43"
column=
"1"
lean-forward=
"true"
selection-start-line=
"43"
selection-start-column=
"1"
selection-end-line=
"43"
selection-end-column=
"1"
/>
<caret
line=
"135"
column=
"15"
lean-forward=
"false"
selection-start-line=
"135"
selection-start-column=
"15"
selection-end-line=
"135"
selection-end-column=
"69"
/>
<folding>
<folding
/>
<marker
date=
"1520950390987"
expanded=
"true"
signature=
"9980:10193"
ph=
"SELECT count... vm_instance"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
templates/dashboard/index-templates.html
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/
urls.py
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
267
"
>
<state
relative-caret-position=
"
420
"
>
<caret
line=
"
24"
column=
"17"
lean-forward=
"true"
selection-start-line=
"24"
selection-start-column=
"17"
selection-end-line=
"24"
selection-end-column=
"17
"
/>
<caret
line=
"
59"
column=
"36"
lean-forward=
"false"
selection-start-line=
"59"
selection-start-column=
"14"
selection-end-line=
"59"
selection-end-column=
"36
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/
dashboard/views/index
.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
common/operations
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
102
"
>
<state
relative-caret-position=
"
429
"
>
<caret
line=
"
62"
column=
"23"
lean-forward=
"true"
selection-start-line=
"62"
selection-start-column=
"23"
selection-end-line=
"62"
selection-end-column=
"23
"
/>
<caret
line=
"
242"
column=
"0"
lean-forward=
"false"
selection-start-line=
"242"
selection-start-column=
"0"
selection-end-line=
"242"
selection-end-column=
"0
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$
PROJECT_DIR$/circle/dashboard/urls
.py"
>
<entry
file=
"file://$
USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/client
.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"267"
>
<state
relative-caret-position=
"233"
>
<caret
line=
"50"
column=
"45"
lean-forward=
"true"
selection-start-line=
"50"
selection-start-column=
"45"
selection-end-line=
"50"
selection-end-column=
"45"
/>
<caret
line=
"82"
column=
"0"
lean-forward=
"false"
selection-start-line=
"82"
selection-start-column=
"0"
selection-end-line=
"82"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/openstack_api/nova.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"225"
>
<caret
line=
"310"
column=
"0"
lean-forward=
"false"
selection-start-line=
"310"
selection-start-column=
"0"
selection-end-line=
"310"
selection-end-column=
"0"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templatetags/instance_tags.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"575"
>
<caret
line=
"36"
column=
"43"
lean-forward=
"true"
selection-start-line=
"36"
selection-start-column=
"43"
selection-end-line=
"36"
selection-end-column=
"43"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"568"
>
<caret
line=
"1139"
column=
"19"
lean-forward=
"false"
selection-start-line=
"1139"
selection-start-column=
"19"
selection-end-line=
"1139"
selection-end-column=
"19"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
...
circle/dashboard/templatetags/instance_tags.py
View file @
cb5e6c89
from
django.template
import
Library
from
django.template
import
Library
from
django.urls
import
reverse
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
register
=
Library
()
register
=
Library
()
...
@@ -29,4 +30,8 @@ def get_status_display(instance):
...
@@ -29,4 +30,8 @@ def get_status_display(instance):
'BUILDING'
:
_
(
'building'
),
'BUILDING'
:
_
(
'building'
),
}
}
return
DISPLAYS
[
instance
.
status
]
if
instance
.
status
in
DISPLAYS
else
instance
.
status
return
DISPLAYS
[
instance
.
status
]
if
instance
.
status
in
DISPLAYS
else
instance
.
status
\ No newline at end of file
@register.filter
def
get_absolute_url
(
instance
):
return
reverse
(
'dashboard.views.detail'
,
args
=
[
instance
.
id
])
\ No newline at end of file
circle/dashboard/views/vm.py
View file @
cb5e6c89
...
@@ -117,10 +117,14 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
...
@@ -117,10 +117,14 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
ops
=
get_operations
(
instance
,
user
,
self
.
request
)
ops
=
get_operations
(
instance
,
user
,
self
.
request
)
hide_tutorial
=
self
.
request
.
COOKIES
.
get
(
hide_tutorial
=
self
.
request
.
COOKIES
.
get
(
"hide_tutorial_for_
%
s"
%
instance
.
id
)
==
"True"
"hide_tutorial_for_
%
s"
%
instance
.
id
)
==
"True"
vnc_console
=
openstack_api
.
nova
.
server_vnc_console
(
self
.
request
,
instance
.
id
)
vnc_console
=
None
try
:
vnc_console
=
openstack_api
.
nova
.
server_vnc_console
(
self
.
request
,
instance
.
id
)
except
:
pass
#TODO
context
.
update
({
context
.
update
({
'graphite_enabled'
:
settings
.
GRAPHITE_URL
is
not
None
,
'graphite_enabled'
:
settings
.
GRAPHITE_URL
is
not
None
,
'vnc_url'
:
vnc_console
.
url
,
'vnc_url'
:
vnc_console
.
url
if
vnc_console
else
None
,
'ops'
:
ops
,
'ops'
:
ops
,
'op'
:
{
i
.
op
:
i
for
i
in
ops
},
'op'
:
{
i
.
op
:
i
for
i
in
ops
},
# 'connect_commands': user.profile.get_connect_commands(instance),
# 'connect_commands': user.profile.get_connect_commands(instance),
...
@@ -1077,7 +1081,7 @@ class VmCreate(LoginRequiredMixin, TemplateView):
...
@@ -1077,7 +1081,7 @@ class VmCreate(LoginRequiredMixin, TemplateView):
pk
=
int
(
pk
))
pk
=
int
(
pk
))
except
(
ValueError
,
InstanceTemplate
.
DoesNotExist
):
except
(
ValueError
,
InstanceTemplate
.
DoesNotExist
):
raise
Http404
()
raise
Http404
()
if
not
template
.
has_level
(
request
.
user
,
'user'
)
:
if
not
request
.
user
.
id
==
template
.
owner_id
:
raise
PermissionDenied
()
raise
PermissionDenied
()
return
template
return
template
...
@@ -1117,16 +1121,25 @@ class VmCreate(LoginRequiredMixin, TemplateView):
...
@@ -1117,16 +1121,25 @@ class VmCreate(LoginRequiredMixin, TemplateView):
})
})
return
self
.
render_to_response
(
context
)
return
self
.
render_to_response
(
context
)
def
_create_from_plain_image
(
self
,
request
,
*
args
,
**
kwargs
):
def
__create_normal
(
self
,
request
,
template
,
*
args
,
**
kwargs
):
pass
server_created
=
openstack_api
.
nova
.
server_create
(
request
,
template
.
name
,
template
.
image_id
,
template
.
flavor_id
,
)
def
__create_normal
(
self
,
request
,
*
args
,
**
kwargs
):
from
dashboard.templatetags.instance_tags
import
get_absolute_url
instances
=
[
Instance
.
create_from_template
(
messages
.
success
(
request
,
_
(
"VM successfully created."
))
template
=
template
,
path
=
get_absolute_url
(
server_created
)
owner
=
request
.
user
)]
return
self
.
__deploy
(
request
,
instances
)
def
__create_customized
(
self
,
request
,
*
args
,
**
kwargs
):
if
request
.
is_ajax
():
return
HttpResponse
(
json
.
dumps
({
'redirect'
:
path
}),
content_type
=
"application/json"
)
else
:
return
HttpResponseRedirect
(
"
%
s#activity"
%
path
)
def
__create_customized
(
self
,
request
,
template
,
*
args
,
**
kwargs
):
user
=
request
.
user
user
=
request
.
user
# no form yet, using POST directly:
# no form yet, using POST directly:
form
=
self
.
form_class
(
form
=
self
.
form_class
(
...
@@ -1171,7 +1184,7 @@ class VmCreate(LoginRequiredMixin, TemplateView):
...
@@ -1171,7 +1184,7 @@ class VmCreate(LoginRequiredMixin, TemplateView):
messages
.
success
(
request
,
ungettext_lazy
(
messages
.
success
(
request
,
ungettext_lazy
(
"Successfully created
%(count)
d VM."
,
# this should not happen
"Successfully created
%(count)
d VM."
,
# this should not happen
"Successfully created
%(count)
d VMs."
,
len
(
instances
))
%
{
"Successfully created
%(count)
d VMs."
,
len
(
instances
))
%
{
'count'
:
len
(
instances
)})
'count'
:
len
(
instances
)})
path
=
"
%
s?stype=owned"
%
reverse
(
"dashboard.views.vm-list"
)
path
=
"
%
s?stype=owned"
%
reverse
(
"dashboard.views.vm-list"
)
else
:
else
:
messages
.
success
(
request
,
_
(
"VM successfully created."
))
messages
.
success
(
request
,
_
(
"VM successfully created."
))
...
@@ -1187,13 +1200,13 @@ class VmCreate(LoginRequiredMixin, TemplateView):
...
@@ -1187,13 +1200,13 @@ class VmCreate(LoginRequiredMixin, TemplateView):
#TODO: check if user can create VM
#TODO: check if user can create VM
#TODO: limit chekcs
#TODO: limit chekcs
create_func
=
(
self
.
_create_from_plain_image
if
template
=
self
.
get_template
(
request
,
request
.
POST
.
get
(
"template"
))
request
.
POST
.
get
(
"from_plain_image"
)
is
not
None
else
self
.
__create_normal
if
create_func
=
(
self
.
__create_normal
if
request
.
POST
.
get
(
"customized"
)
is
None
else
request
.
POST
.
get
(
"customized"
)
is
None
else
self
.
__create_customized
)
self
.
__create_customized
)
return
create_func
(
request
,
*
args
,
**
kwargs
)
return
create_func
(
request
,
template
,
*
args
,
**
kwargs
)
# @require_GET
# @require_GET
...
...
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