Commit ef0ed6be by Szabolcs Gelencser

Enable 'Add network interface' operation

parent cb15e6e4
......@@ -2,8 +2,10 @@
<project version="4">
<component name="ChangeListManager">
<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$/circle/network/views.py" afterPath="$PROJECT_DIR$/circle/network/views.py" />
<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/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>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
......@@ -29,43 +31,34 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="views.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/network/views.py">
<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">
<file leaf-file-name="network.html" pinned="false" current-in-tab="false">
<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="862">
<caret line="579" column="34" lean-forward="false" selection-start-line="579" selection-start-column="34" selection-end-line="579" selection-end-column="34" />
<state relative-caret-position="119">
<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>
</file>
<file leaf-file-name="models.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/network/models.py">
<file leaf-file-name="vm.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.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 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>
<element signature="e#731#787#0" expanded="true" />
<element signature="e#40423#41594#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="vxlan-create.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html">
<file leaf-file-name="operations.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="257">
<caret line="25" column="53" lean-forward="false" selection-start-line="25" selection-start-column="53" selection-end-line="25" selection-end-column="53" />
<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>
......@@ -83,17 +76,6 @@
</component>
<component name="FindInProjectRecents">
<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>tag</find>
<find>editor.</find>
......@@ -113,6 +95,17 @@
<find>create</find>
<find>server_cr</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>
<replaceStrings>
<replace>'ACTIVE'</replace>
......@@ -127,8 +120,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<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/circle/urls.py" />
<option value="$PROJECT_DIR$/circle/common/views.py" />
......@@ -173,11 +164,13 @@
<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/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/network/models.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/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>
</option>
</component>
......@@ -247,6 +240,19 @@
<item name="cloud" 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" />
</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>
<select />
</subPane>
......@@ -261,7 +267,7 @@
<property name="settings.editor.selected.configurable" value="watcher.settings" />
<property name="NewWatcherDialog.advanced.open" value="true" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="SearchEverywhereHistoryKey" value="create&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;vxl&#9;null&#9;null&#10;nov&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/nova.py&#10;nova.p&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/nova.py&#10;vmdetailv&#9;null&#9;null&#10;editor&#9;null&#9;null&#10;networktopo&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/static/js/horizon.networktopology.js&#10;bow&#9;FILE&#9;file:///home/h3yduck/cloud/circle/bower.json&#10;base.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;local&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;index&#9;null&#9;null&#10;vnc&#9;null&#9;null&#10;plain&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-plain-image-create.html&#10;forms&#9;null&#9;null&#10;vxlanform&#9;null&#9;null&#10;instanc&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;index-vxla&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html&#10;instance&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;_vm-c&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/_vm-create-1.html&#10;vmcrea&#9;null&#9;null&#10;loginV&#9;null&#9;null&#10;index.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;sleep&#9;null&#9;null&#10;Deploy&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;Vmdeta&#9;null&#9;null&#10;list_from&#9;null&#9;null&#10;aclupda&#9;null&#9;null&#10;base.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;method&#9;ACTION&#9;GoToMenuEx&#10;base.ht&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;base.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/base.html&#10;index.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;server&#9;null&#9;null&#10;Disk&#9;null&#9;null" />
<property name="SearchEverywhereHistoryKey" value="instance&#9;null&#9;null&#10;opera&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;create&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;vxl&#9;null&#9;null&#10;nov&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/nova.py&#10;nova.p&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/nova.py&#10;vmdetailv&#9;null&#9;null&#10;editor&#9;null&#9;null&#10;networktopo&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/static/js/horizon.networktopology.js&#10;bow&#9;FILE&#9;file:///home/h3yduck/cloud/circle/bower.json&#10;base.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;local&#9;null&#9;null&#10;index&#9;null&#9;null&#10;vnc&#9;null&#9;null&#10;plain&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-plain-image-create.html&#10;forms&#9;null&#9;null&#10;vxlanform&#9;null&#9;null&#10;instanc&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;index-vxla&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html&#10;_vm-c&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/_vm-create-1.html&#10;vmcrea&#9;null&#9;null&#10;loginV&#9;null&#9;null&#10;index.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;sleep&#9;null&#9;null&#10;Deploy&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;Vmdeta&#9;null&#9;null&#10;list_from&#9;null&#9;null&#10;aclupda&#9;null&#9;null&#10;base.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;method&#9;ACTION&#9;GoToMenuEx&#10;base.ht&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/base.html&#10;base.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/base.html&#10;index.py&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index.htm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;server&#9;null&#9;null&#10;Disk&#9;null&#9;null" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
......@@ -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="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="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="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="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" 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="false" 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="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" />
......@@ -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="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="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" />
</layout>
<layout-to-restore>
......@@ -539,48 +545,6 @@
</expressions>
</component>
<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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
......@@ -739,6 +703,7 @@
<provider selected="true" editor-type-id="text-editor">
<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" />
<folding />
</state>
</provider>
</entry>
......@@ -838,16 +803,6 @@
</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="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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="831">
......@@ -882,14 +837,32 @@
</state>
</provider>
</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">
<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" />
<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" />
<folding />
</state>
</provider>
</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">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="862">
......@@ -898,39 +871,80 @@
</state>
</provider>
</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">
<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 />
</state>
</provider>
</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">
<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" />
<state relative-caret-position="178">
<caret line="117" column="28" lean-forward="false" selection-start-line="117" selection-start-column="19" selection-end-line="117" selection-end-column="28" />
<folding />
</state>
</provider>
</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">
<state relative-caret-position="257">
<caret line="25" column="53" lean-forward="false" selection-start-line="25" selection-start-column="53" selection-end-line="25" selection-end-column="53" />
<state relative-caret-position="178">
<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 />
</state>
</provider>
</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">
<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" />
<state relative-caret-position="119">
<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>
<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>
</state>
</provider>
</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>
</project>
\ No newline at end of file
......@@ -8,15 +8,6 @@
<i class="fa fa-{{op.icon}}"></i> {% trans "add interface" %}</a>
{% endif %}{% endwith %}
</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>
{% trans "Interfaces" %}
</h2>
......
......@@ -60,7 +60,8 @@ from .util import (
FormOperationMixin, FilterMixin, GraphMixin
)
from ..forms import (
AclUserOrGroupAddForm, VmResourcesForm, VmCustomizeForm, VmDeployForm, VmFromPlainImageForm)
AclUserOrGroupAddForm, VmResourcesForm, VmCustomizeForm, VmDeployForm, VmFromPlainImageForm, VmRemoveInterfaceForm,
VmAddInterfaceForm)
logger = logging.getLogger(__name__)
......@@ -308,52 +309,51 @@ def get_operations(instance, user, request):
else:
ops.append(v.bind_to_object(instance))
return ops
#
#
# class VmRemoveInterfaceView(FormOperationMixin, VmOperationView):
# op = 'remove_interface'
# form_class = VmRemoveInterfaceForm
# show_in_toolbar = False
# wait_for_result = 0.5
# icon = 'times'
# effect = "danger"
# with_reload = True
#
# def get_form_kwargs(self):
# instance = self.get_op().instance
# choices = instance.interface_set.all()
# interface_pk = self.request.GET.get('interface')
# if interface_pk:
# try:
# default = choices.get(pk=interface_pk)
# except (ValueError, Interface.DoesNotExist):
# raise Http404()
# else:
# default = None
#
# val = super(VmRemoveInterfaceView, self).get_form_kwargs()
# val.update({'choices': choices, 'default': default})
# return val
#
#
# class VmAddInterfaceView(FormOperationMixin, VmOperationView):
#
# op = 'add_interface'
# form_class = VmAddInterfaceForm
# show_in_toolbar = False
# icon = 'globe'
# effect = 'success'
# with_reload = True
#
# def get_form_kwargs(self):
# inst = self.get_op().instance
# choices = Vlan.get_objects_with_level(
# "user", self.request.user).exclude(
# vm_interface__instance__in=[inst])
# val = super(VmAddInterfaceView, self).get_form_kwargs()
# val.update({'choices': choices})
# return val
#
class VmRemoveInterfaceView(FormOperationMixin, VmOperationView):
op = 'remove_interface'
form_class = VmRemoveInterfaceForm
show_in_toolbar = False
wait_for_result = 0.5
icon = 'times'
effect = "danger"
with_reload = True
def get_form_kwargs(self):
instance = self.get_op().instance
choices = instance.interface_set.all()
interface_pk = self.request.GET.get('interface')
if interface_pk:
try:
default = choices.get(pk=interface_pk)
except (ValueError, Interface.DoesNotExist):
raise Http404()
else:
default = None
val = super(VmRemoveInterfaceView, self).get_form_kwargs()
val.update({'choices': choices, 'default': default})
return val
class VmAddInterfaceView(FormOperationMixin, VmOperationView):
op = 'add_interface'
form_class = VmAddInterfaceForm
show_in_toolbar = False
icon = 'globe'
effect = 'success'
with_reload = True
def get_form_kwargs(self):
inst = self.get_op().instance
choices = Vlan.get_objects_with_level(
"user", self.request.user).exclude(
vm_interface__instance__in=[inst])
val = super(VmAddInterfaceView, self).get_form_kwargs()
val.update({'choices': choices})
return val
#
# class VmDiskModifyView(FormOperationMixin, VmOperationView):
# show_in_toolbar = False
......@@ -761,8 +761,8 @@ vm_ops = OrderedDict([
# ('remove_disk', VmDiskModifyView.factory(
# op='remove_disk', form_class=VmDiskRemoveForm,
# icon='times', effect="danger")),
# ('add_interface', VmAddInterfaceView),
# ('remove_interface', VmRemoveInterfaceView),
('add_interface', VmAddInterfaceView),
('remove_interface', VmRemoveInterfaceView),
# ('remove_port', VmPortRemoveView),
# ('add_port', VmPortAddView),
# ('renew', VmRenewView),
......
......@@ -185,46 +185,12 @@ class RemoteAgentOperation(EnsureAgentMixin, RemoteInstanceOperation):
class AddInterfaceOperation(InstanceOperation):
id = 'add_interface'
name = _("add interface")
description = _("Add a new network interface for the specified VLAN to "
"the VM.")
required_perms = ()
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()
description = _("Add a new network interface for the specified network to the VM.")
accept_states = ('SHUTOFF', 'ACTIVE') #TODO: try other states
os_policy_actions = (("compute", "compute:attach_interface"),)
def _operation(self, activity, user, system, vlan, managed=None):
if not vlan.has_level(user, 'user'):
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'])
print("Adding interface")
@register_operation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment