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
ef0ed6be
authored
Mar 08, 2018
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable 'Add network interface' operation
parent
cb15e6e4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
206 deletions
+178
-206
.idea/workspace.xml
+126
-111
circle/dashboard/templates/dashboard/vm-detail/network.html
+0
-9
circle/dashboard/views/vm.py
+48
-48
circle/vm/operations.py
+4
-38
No files found.
.idea/workspace.xml
View file @
ef0ed6be
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
<project
version=
"4"
>
<project
version=
"4"
>
<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$/circle/network/templates/network/vxlan-create.html"
afterPath=
"$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
/>
<change
beforePath=
"$PROJECT_DIR$/circle/network/views.py"
afterPath=
"$PROJECT_DIR$/circle/network/views.py"
/>
<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/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"
/>
...
@@ -29,43 +31,34 @@
...
@@ -29,43 +31,34 @@
</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=
"views.py"
pinned=
"false"
current-in-tab=
"true"
>
<file
leaf-file-name=
"network.html"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/network/views.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"153"
>
<caret
line=
"999"
column=
"12"
lean-forward=
"true"
selection-start-line=
"999"
selection-start-column=
"12"
selection-end-line=
"999"
selection-end-column=
"12"
/>
<folding>
<element
signature=
"e#732#743#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"base.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/settings/base.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
862
"
>
<state
relative-caret-position=
"
119
"
>
<caret
line=
"
579"
column=
"34"
lean-forward=
"false"
selection-start-line=
"579"
selection-start-column=
"34"
selection-end-line=
"579"
selection-end-column=
"34
"
/>
<caret
line=
"
7"
column=
"20"
lean-forward=
"false"
selection-start-line=
"7"
selection-start-column=
"20"
selection-end-line=
"7"
selection-end-column=
"20
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"
models
.py"
pinned=
"false"
current-in-tab=
"false"
>
<file
leaf-file-name=
"
vm
.py"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
network/models
.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=
"692"
>
<state
relative-caret-position=
"207"
>
<caret
line=
"96"
column=
"72"
lean-forward=
"false"
selection-start-line=
"96"
selection-start-column=
"72"
selection-end-line=
"96"
selection-end-column=
"72"
/>
<caret
line=
"341"
column=
"31"
lean-forward=
"false"
selection-start-line=
"341"
selection-start-column=
"31"
selection-end-line=
"341"
selection-end-column=
"31"
/>
<folding
/>
<folding>
<element
signature=
"e#731#787#0"
expanded=
"true"
/>
<element
signature=
"e#40423#41594#0"
expanded=
"false"
/>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
</file>
</file>
<file
leaf-file-name=
"
vxlan-create.html"
pinned=
"false"
current-in-tab=
"fals
e"
>
<file
leaf-file-name=
"
operations.py"
pinned=
"false"
current-in-tab=
"tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
network/templates/network/vxlan-create.html
"
>
<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=
"2
5
7"
>
<state
relative-caret-position=
"2
0
7"
>
<caret
line=
"
25"
column=
"53"
lean-forward=
"false"
selection-start-line=
"25"
selection-start-column=
"53"
selection-end-line=
"25"
selection-end-column=
"53
"
/>
<caret
line=
"
184"
column=
"39"
lean-forward=
"false"
selection-start-line=
"184"
selection-start-column=
"39"
selection-end-line=
"184"
selection-end-column=
"39
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
...
@@ -83,17 +76,6 @@
...
@@ -83,17 +76,6 @@
</component>
</component>
<component
name=
"FindInProjectRecents"
>
<component
name=
"FindInProjectRecents"
>
<findStrings>
<findStrings>
<find>
VxlanForm
</find>
<find>
vxlancrea
</find>
<find>
forms
</find>
<find>
vnc
</find>
<find>
c
</find>
<find>
span
</find>
<find>
network
</find>
<find>
static
</find>
<find>
{% javascript
</find>
<find>
datastore
</find>
<find>
horizon/client_side/
</find>
<find>
jstemplate
</find>
<find>
jstemplate
</find>
<find>
tag
</find>
<find>
tag
</find>
<find>
editor.
</find>
<find>
editor.
</find>
...
@@ -113,6 +95,17 @@
...
@@ -113,6 +95,17 @@
<find>
create
</find>
<find>
create
</find>
<find>
server_cr
</find>
<find>
server_cr
</find>
<find>
server_create
</find>
<find>
server_create
</find>
<find>
vmaddin
</find>
<find>
vmaddinter
</find>
<find>
VmAddInterfaceForm
</find>
<find>
addinterfac
</find>
<find>
states
</find>
<find>
status
</find>
<find>
addinterface
</find>
<find>
addinterf
</find>
<find>
polic
</find>
<find>
addinterfa
</find>
<find>
interface
</find>
</findStrings>
</findStrings>
<replaceStrings>
<replaceStrings>
<replace>
'ACTIVE'
</replace>
<replace>
'ACTIVE'
</replace>
...
@@ -127,8 +120,6 @@
...
@@ -127,8 +120,6 @@
<component
name=
"IdeDocumentHistory"
>
<component
name=
"IdeDocumentHistory"
>
<option
name=
"CHANGED_PATHS"
>
<option
name=
"CHANGED_PATHS"
>
<list>
<list>
<option
value=
"$PROJECT_DIR$/circle/dashboard/models.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/index.html"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/circle/urls.py"
/>
<option
value=
"$PROJECT_DIR$/circle/common/views.py"
/>
<option
value=
"$PROJECT_DIR$/circle/common/views.py"
/>
...
@@ -173,11 +164,13 @@
...
@@ -173,11 +164,13 @@
<option
value=
"$PROJECT_DIR$/circle/dashboard/static/vue.css"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/static/vue.css"
/>
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html"
/>
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html"
/>
<option
value=
"$PROJECT_DIR$/circle/network/forms.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/forms.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/network/models.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/models.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/views.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/views.py"
/>
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html"
/>
<option
value=
"$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html"
/>
<option
value=
"$PROJECT_DIR$/circle/dashboard/views/vm.py"
/>
<option
value=
"$PROJECT_DIR$/circle/vm/operations.py"
/>
</list>
</list>
</option>
</option>
</component>
</component>
...
@@ -247,6 +240,19 @@
...
@@ -247,6 +240,19 @@
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</path>
<path>
<item
name=
"cloud"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"cloud"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"circle"
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=
"circle"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"os_policies"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</expand>
</expand>
<select
/>
<select
/>
</subPane>
</subPane>
...
@@ -261,7 +267,7 @@
...
@@ -261,7 +267,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=
"
create	FILE	file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py 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 vmdeta	null	null index	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 instance	FILE	file:///home/h3yduck/cloud/circle/vm/models/instance.py
_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 Instance	null	null Vmdeta	null	null list_from	null	null aclupda	null	null base.htm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/base.html method	ACTION	GoToMenuEx base.ht	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/base.html base.html	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/base.html index.py	FILE	file:///home/h3yduck/cloud/circle/dashboard/views/index.py index.htm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html server	null	null Disk	null	null"
/>
<property
name=
"SearchEverywhereHistoryKey"
value=
"
instance	null	null opera	null	null vmdeta	null	null create	FILE	file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html base	FILE	file:///home/h3yduck/cloud/circle/circle/settings/base.py 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 index	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 Instance	null	null Vmdeta	null	null list_from	null	null aclupda	null	null base.htm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/base.html method	ACTION	GoToMenuEx base.ht	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/base.html base.html	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/base.html index.py	FILE	file:///home/h3yduck/cloud/circle/dashboard/views/index.py index.htm	FILE	file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html server	null	null Disk	null	null"
/>
</component>
</component>
<component
name=
"RecentsManager"
>
<component
name=
"RecentsManager"
>
<key
name=
"MoveFile.RECENT_KEYS"
>
<key
name=
"MoveFile.RECENT_KEYS"
>
...
@@ -371,10 +377,11 @@
...
@@ -371,10 +377,11 @@
<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"
/>
<window_info
id=
"Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32980973"
sideWeight=
"0.5"
order=
"1"
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=
"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=
"
tru
e"
show_stripe_button=
"true"
weight=
"0.35200846"
sideWeight=
"0.5101172"
order=
"3"
side_tool=
"false"
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.35200846"
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=
"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"
/>
...
@@ -382,7 +389,6 @@
...
@@ -382,7 +389,6 @@
<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"
/>
<window_info
id=
"Coverage"
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=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Coverage"
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=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Hierarchy"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Hierarchy"
active=
"false"
anchor=
"right"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"combo"
/>
<window_info
id=
"Find"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32980973"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Ant Build"
active=
"false"
anchor=
"right"
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=
"Ant Build"
active=
"false"
anchor=
"right"
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"
/>
</layout>
</layout>
<layout-to-restore>
<layout-to-restore>
...
@@ -539,48 +545,6 @@
...
@@ -539,48 +545,6 @@
</expressions>
</expressions>
</component>
</component>
<component
name=
"editorHistoryManager"
>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/circle/bower_components/hogan.js/web/builds/3.0.2/hogan-3.0.2.js"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-306"
>
<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/network/templates/network/horizon/client_side/_alert_message.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"20"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"20"
selection-end-line=
"0"
selection-end-column=
"20"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/horizon/client_side/_confirm.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"20"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"20"
selection-end-line=
"0"
selection-end-column=
"20"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/horizon/client_side/_loading_inline.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"20"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"20"
selection-end-line=
"0"
selection-end-column=
"20"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/horizon/client_side/_progress.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"20"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"20"
selection-end-line=
"0"
selection-end-column=
"20"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/horizon/client_side/_table_row.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<caret
line=
"0"
column=
"20"
lean-forward=
"false"
selection-start-line=
"0"
selection-start-column=
"20"
selection-end-line=
"0"
selection-end-column=
"20"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/horizon/client_side/template.html"
>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/horizon/client_side/template.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"0"
>
<state
relative-caret-position=
"0"
>
...
@@ -739,6 +703,7 @@
...
@@ -739,6 +703,7 @@
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"170"
>
<state
relative-caret-position=
"170"
>
<caret
line=
"84"
column=
"13"
lean-forward=
"false"
selection-start-line=
"84"
selection-start-column=
"13"
selection-end-line=
"84"
selection-end-column=
"65"
/>
<caret
line=
"84"
column=
"13"
lean-forward=
"false"
selection-start-line=
"84"
selection-start-column=
"13"
selection-end-line=
"84"
selection-end-column=
"65"
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
...
@@ -838,16 +803,6 @@
...
@@ -838,16 +803,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/views/vm.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"518"
>
<caret
line=
"1031"
column=
"39"
lean-forward=
"true"
selection-start-line=
"1031"
selection-start-column=
"39"
selection-end-line=
"1031"
selection-end-column=
"39"
/>
<folding>
<element
signature=
"e#40463#41634#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/urls.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/urls.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"831"
>
<state
relative-caret-position=
"831"
>
...
@@ -882,14 +837,32 @@
...
@@ -882,14 +837,32 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$
PROJECT_DIR$/circle/network/models
.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=
"
692
"
>
<state
relative-caret-position=
"
306
"
>
<caret
line=
"
96"
column=
"72"
lean-forward=
"false"
selection-start-line=
"96"
selection-start-column=
"72"
selection-end-line=
"96"
selection-end-column=
"72
"
/>
<caret
line=
"
836"
column=
"8"
lean-forward=
"false"
selection-start-line=
"836"
selection-start-column=
"8"
selection-end-line=
"836"
selection-end-column=
"8
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/openstack_api/neutron.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"663"
>
<caret
line=
"1121"
column=
"43"
lean-forward=
"false"
selection-start-line=
"1121"
selection-start-column=
"43"
selection-end-line=
"1121"
selection-end-column=
"43"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/views.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"442"
>
<caret
line=
"1016"
column=
"45"
lean-forward=
"false"
selection-start-line=
"1016"
selection-start-column=
"45"
selection-end-line=
"1016"
selection-end-column=
"45"
/>
<folding>
<element
signature=
"e#732#743#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/settings/base.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/circle/settings/base.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"862"
>
<state
relative-caret-position=
"862"
>
...
@@ -898,39 +871,80 @@
...
@@ -898,39 +871,80 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py"
>
<entry
file=
"file://$PROJECT_DIR$/circle/network/models.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"692"
>
<caret
line=
"96"
column=
"72"
lean-forward=
"false"
selection-start-line=
"96"
selection-start-column=
"72"
selection-end-line=
"96"
selection-end-column=
"72"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"335"
>
<caret
line=
"25"
column=
"53"
lean-forward=
"false"
selection-start-line=
"25"
selection-start-column=
"53"
selection-end-line=
"25"
selection-end-column=
"53"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/dashboard/forms.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"
>
<caret
line=
"
836"
column=
"8"
lean-forward=
"false"
selection-start-line=
"836"
selection-start-column=
"8"
selection-end-line=
"836"
selection-end-column=
"8
"
/>
<caret
line=
"
990"
column=
"6"
lean-forward=
"false"
selection-start-line=
"990"
selection-start-column=
"6"
selection-end-line=
"990"
selection-end-column=
"24
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/
openstack_api/neutron.py
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
circle/os_policies/neutron_policy.json
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
663
"
>
<state
relative-caret-position=
"
178
"
>
<caret
line=
"11
21"
column=
"43"
lean-forward=
"false"
selection-start-line=
"1121"
selection-start-column=
"43"
selection-end-line=
"1121"
selection-end-column=
"43
"
/>
<caret
line=
"11
7"
column=
"28"
lean-forward=
"false"
selection-start-line=
"117"
selection-start-column=
"19"
selection-end-line=
"117"
selection-end-column=
"28
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/
network/templates/network/vxlan-create.html
"
>
<entry
file=
"file://$PROJECT_DIR$/circle/
circle/os_policies/nova_policy.json
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
257
"
>
<state
relative-caret-position=
"
178
"
>
<caret
line=
"
25"
column=
"53"
lean-forward=
"false"
selection-start-line=
"25"
selection-start-column=
"53"
selection-end-line=
"25"
selection-end-column=
"53
"
/>
<caret
line=
"
50"
column=
"29"
lean-forward=
"false"
selection-start-line=
"50"
selection-start-column=
"20"
selection-end-line=
"50"
selection-end-column=
"29
"
/>
<folding
/>
<folding
/>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/
network/views.py
"
>
<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=
"153"
>
<state
relative-caret-position=
"119"
>
<caret
line=
"999"
column=
"12"
lean-forward=
"true"
selection-start-line=
"999"
selection-start-column=
"12"
selection-end-line=
"999"
selection-end-column=
"12"
/>
<caret
line=
"7"
column=
"20"
lean-forward=
"false"
selection-start-line=
"7"
selection-start-column=
"20"
selection-end-line=
"7"
selection-end-column=
"20"
/>
<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=
"207"
>
<caret
line=
"341"
column=
"31"
lean-forward=
"false"
selection-start-line=
"341"
selection-start-column=
"31"
selection-end-line=
"341"
selection-end-column=
"31"
/>
<folding>
<folding>
<element
signature=
"e#732#743#0"
expanded=
"true"
/>
<element
signature=
"e#731#787#0"
expanded=
"true"
/>
<element
signature=
"e#40423#41594#0"
expanded=
"false"
/>
</folding>
</folding>
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/circle/vm/models/instance.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"224"
>
<caret
line=
"213"
column=
"8"
lean-forward=
"false"
selection-start-line=
"213"
selection-start-column=
"8"
selection-end-line=
"221"
selection-end-column=
"36"
/>
<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=
"207"
>
<caret
line=
"184"
column=
"39"
lean-forward=
"false"
selection-start-line=
"184"
selection-start-column=
"39"
selection-end-line=
"184"
selection-end-column=
"39"
/>
<folding
/>
</state>
</provider>
</entry>
</component>
</component>
</project>
</project>
\ No newline at end of file
circle/dashboard/templates/dashboard/vm-detail/network.html
View file @
ef0ed6be
...
@@ -8,15 +8,6 @@
...
@@ -8,15 +8,6 @@
<i
class=
"fa fa-{{op.icon}}"
></i>
{% trans "add interface" %}
</a>
<i
class=
"fa fa-{{op.icon}}"
></i>
{% trans "add interface" %}
</a>
{% endif %}{% endwith %}
{% endif %}{% endwith %}
</div>
</div>
<br
/>
<br
/>
<div
id=
"vm-details-add-user-interface"
>
{% with op=op.add_user_interface %}{% if op %}
<a
href=
"{{op.get_url}}"
class=
"btn btn-{{op.effect}} operation pull-right"
{%
if
op
.
disabled
%}
disabled
{%
endif
%}
>
<i
class=
"fa fa-{{op.icon}}"
></i>
{% trans "add user interface" %}
</a>
{% endif %}{% endwith %}
</div>
<h2>
<h2>
{% trans "Interfaces" %}
{% trans "Interfaces" %}
</h2>
</h2>
...
...
circle/dashboard/views/vm.py
View file @
ef0ed6be
...
@@ -60,7 +60,8 @@ from .util import (
...
@@ -60,7 +60,8 @@ from .util import (
FormOperationMixin
,
FilterMixin
,
GraphMixin
FormOperationMixin
,
FilterMixin
,
GraphMixin
)
)
from
..forms
import
(
from
..forms
import
(
AclUserOrGroupAddForm
,
VmResourcesForm
,
VmCustomizeForm
,
VmDeployForm
,
VmFromPlainImageForm
)
AclUserOrGroupAddForm
,
VmResourcesForm
,
VmCustomizeForm
,
VmDeployForm
,
VmFromPlainImageForm
,
VmRemoveInterfaceForm
,
VmAddInterfaceForm
)
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -308,52 +309,51 @@ def get_operations(instance, user, request):
...
@@ -308,52 +309,51 @@ def get_operations(instance, user, request):
else
:
else
:
ops
.
append
(
v
.
bind_to_object
(
instance
))
ops
.
append
(
v
.
bind_to_object
(
instance
))
return
ops
return
ops
#
#
#
class
VmRemoveInterfaceView
(
FormOperationMixin
,
VmOperationView
):
# class VmRemoveInterfaceView(FormOperationMixin, VmOperationView):
op
=
'remove_interface'
# op = 'remove_interface'
form_class
=
VmRemoveInterfaceForm
# form_class = VmRemoveInterfaceForm
show_in_toolbar
=
False
# show_in_toolbar = False
wait_for_result
=
0.5
# wait_for_result = 0.5
icon
=
'times'
# icon = 'times'
effect
=
"danger"
# effect = "danger"
with_reload
=
True
# with_reload = True
#
def
get_form_kwargs
(
self
):
# def get_form_kwargs(self):
instance
=
self
.
get_op
()
.
instance
# instance = self.get_op().instance
choices
=
instance
.
interface_set
.
all
()
# choices = instance.interface_set.all()
interface_pk
=
self
.
request
.
GET
.
get
(
'interface'
)
# interface_pk = self.request.GET.get('interface')
if
interface_pk
:
# if interface_pk:
try
:
# try:
default
=
choices
.
get
(
pk
=
interface_pk
)
# default = choices.get(pk=interface_pk)
except
(
ValueError
,
Interface
.
DoesNotExist
):
# except (ValueError, Interface.DoesNotExist):
raise
Http404
()
# raise Http404()
else
:
# else:
default
=
None
# default = None
#
val
=
super
(
VmRemoveInterfaceView
,
self
)
.
get_form_kwargs
()
# val = super(VmRemoveInterfaceView, self).get_form_kwargs()
val
.
update
({
'choices'
:
choices
,
'default'
:
default
})
# val.update({'choices': choices, 'default': default})
return
val
# return val
#
#
class
VmAddInterfaceView
(
FormOperationMixin
,
VmOperationView
):
# class VmAddInterfaceView(FormOperationMixin, VmOperationView):
op
=
'add_interface'
#
form_class
=
VmAddInterfaceForm
# op = 'add_interface'
show_in_toolbar
=
False
# form_class = VmAddInterfaceForm
icon
=
'globe'
# show_in_toolbar = False
effect
=
'success'
# icon = 'globe'
with_reload
=
True
# effect = 'success'
# with_reload = True
def
get_form_kwargs
(
self
):
#
inst
=
self
.
get_op
()
.
instance
# def get_form_kwargs(self):
choices
=
Vlan
.
get_objects_with_level
(
# inst = self.get_op().instance
"user"
,
self
.
request
.
user
)
.
exclude
(
# choices = Vlan.get_objects_with_level(
vm_interface__instance__in
=
[
inst
])
# "user", self.request.user).exclude(
val
=
super
(
VmAddInterfaceView
,
self
)
.
get_form_kwargs
()
# vm_interface__instance__in=[inst])
val
.
update
({
'choices'
:
choices
})
# val = super(VmAddInterfaceView, self).get_form_kwargs()
return
val
# val.update({'choices': choices})
# return val
#
#
#
# class VmDiskModifyView(FormOperationMixin, VmOperationView):
# class VmDiskModifyView(FormOperationMixin, VmOperationView):
# show_in_toolbar = False
# show_in_toolbar = False
...
@@ -761,8 +761,8 @@ vm_ops = OrderedDict([
...
@@ -761,8 +761,8 @@ vm_ops = OrderedDict([
# ('remove_disk', VmDiskModifyView.factory(
# ('remove_disk', VmDiskModifyView.factory(
# op='remove_disk', form_class=VmDiskRemoveForm,
# op='remove_disk', form_class=VmDiskRemoveForm,
# icon='times', effect="danger")),
# icon='times', effect="danger")),
#
('add_interface', VmAddInterfaceView),
(
'add_interface'
,
VmAddInterfaceView
),
#
('remove_interface', VmRemoveInterfaceView),
(
'remove_interface'
,
VmRemoveInterfaceView
),
# ('remove_port', VmPortRemoveView),
# ('remove_port', VmPortRemoveView),
# ('add_port', VmPortAddView),
# ('add_port', VmPortAddView),
# ('renew', VmRenewView),
# ('renew', VmRenewView),
...
...
circle/vm/operations.py
View file @
ef0ed6be
...
@@ -185,46 +185,12 @@ class RemoteAgentOperation(EnsureAgentMixin, RemoteInstanceOperation):
...
@@ -185,46 +185,12 @@ class RemoteAgentOperation(EnsureAgentMixin, RemoteInstanceOperation):
class
AddInterfaceOperation
(
InstanceOperation
):
class
AddInterfaceOperation
(
InstanceOperation
):
id
=
'add_interface'
id
=
'add_interface'
name
=
_
(
"add interface"
)
name
=
_
(
"add interface"
)
description
=
_
(
"Add a new network interface for the specified VLAN to "
description
=
_
(
"Add a new network interface for the specified network to the VM."
)
"the VM."
)
accept_states
=
(
'SHUTOFF'
,
'ACTIVE'
)
#TODO: try other states
required_perms
=
()
os_policy_actions
=
((
"compute"
,
"compute:attach_interface"
),)
accept_states
=
(
'STOPPED'
,
'PENDING'
,
'ACTIVE'
)
accept_states
=
(
'STOPPED'
,
'PENDING'
,
'RUNNING'
)
network_type
=
None
def
rollback
(
self
,
net
,
activity
):
with
activity
.
sub_activity
(
'destroying_net'
,
readable_name
=
ugettext_noop
(
"destroy network (rollback)"
)):
net
.
destroy
()
net
.
delete
()
def
_operation
(
self
,
activity
,
user
,
system
,
vlan
,
managed
=
None
):
def
_operation
(
self
,
activity
,
user
,
system
,
vlan
,
managed
=
None
):
if
not
vlan
.
has_level
(
user
,
'user'
):
print
(
"Adding interface"
)
raise
humanize_exception
(
ugettext_noop
(
"User acces to vlan
%(vlan)
s is required."
),
PermissionDenied
(),
vlan
=
vlan
)
if
managed
is
None
:
managed
=
vlan
.
managed
net
=
Interface
.
create
(
base_activity
=
activity
,
instance
=
self
.
instance
,
managed
=
managed
,
owner
=
user
,
vlan
=
vlan
)
if
self
.
instance
.
is_running
:
try
:
self
.
instance
.
_attach_network
(
interface
=
net
,
parent_activity
=
activity
)
except
Exception
as
e
:
if
hasattr
(
e
,
'libvirtError'
):
self
.
rollback
(
net
,
activity
)
raise
net
.
deploy
()
self
.
instance
.
_change_ip
(
parent_activity
=
activity
)
self
.
instance
.
_restart_networking
(
parent_activity
=
activity
)
def
get_activity_name
(
self
,
kwargs
):
return
create_readable
(
ugettext_noop
(
"add
%(vlan)
s interface"
),
vlan
=
kwargs
[
'vlan'
])
@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