Commit 0a3d40e0 by Szabolcs Gelencser

Show connected vms of network

parent 2c453601
......@@ -2,13 +2,9 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1fbec8af-5a7c-40f9-b994-83ac07d1ae1d" name="Default" comment="">
<change beforePath="" afterPath="$PROJECT_DIR$/circle/network/operations.py" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/circle/network/forms.py" afterPath="$PROJECT_DIR$/circle/network/forms.py" />
<change beforePath="$PROJECT_DIR$/circle/network/models.py" afterPath="$PROJECT_DIR$/circle/network/models.py" />
<change beforePath="$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html" afterPath="$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html" />
<change beforePath="$PROJECT_DIR$/circle/network/views.py" afterPath="$PROJECT_DIR$/circle/network/views.py" />
<change beforePath="$PROJECT_DIR$/circle/openstack_api/neutron.py" afterPath="$PROJECT_DIR$/circle/openstack_api/neutron.py" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
......@@ -38,34 +34,36 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="operations.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/network/operations.py">
<file leaf-file-name="vxlan-edit.html" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="58" column="63" lean-forward="false" selection-start-line="58" selection-start-column="63" selection-end-line="58" selection-end-column="63" />
<state relative-caret-position="431">
<caret line="54" column="29" lean-forward="false" selection-start-line="54" selection-start-column="29" selection-end-line="54" selection-end-column="29" />
<folding>
<element signature="e#0#20#0" expanded="true" />
<element signature="n#style#0;n#tr#0;n#table#0;n#div#1;n#div#3;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="neutron.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/openstack_api/neutron.py">
<file leaf-file-name="views.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/network/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="1384" column="4" lean-forward="false" selection-start-line="1384" selection-start-column="4" selection-end-line="1384" selection-end-column="4" />
<state relative-caret-position="180">
<caret line="1040" column="28" lean-forward="false" selection-start-line="1040" selection-start-column="28" selection-end-line="1040" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="operations.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<entry file="file://$PROJECT_DIR$/circle/network/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="52">
<caret line="89" column="0" lean-forward="false" selection-start-line="89" selection-start-column="0" selection-end-line="89" selection-end-column="0" />
<folding />
<state relative-caret-position="448">
<caret line="57" column="15" lean-forward="false" selection-start-line="57" selection-start-column="15" selection-end-line="57" selection-end-column="47" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
......@@ -82,7 +80,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>sleepoper</find>
<find>removeinterface</find>
<find>vm_op</find>
<find>hidden</find>
......@@ -95,7 +92,6 @@
<find>v</find>
<find>get_template_names</find>
<find>operation-w</find>
<find>vxlandele</find>
<find>operation-wrapper</find>
<find>delete</find>
<find>network:</find>
......@@ -109,9 +105,11 @@
<find>vm_ops</find>
<find>network_op</find>
<find>vmdetail</find>
<find>vxlandeta</find>
<find>vxlandelete</find>
<find>vmdeply</find>
<find>connect</find>
<find>vxlandele</find>
<find>vxlandeta</find>
</findStrings>
<replaceStrings>
<replace>'ACTIVE'</replace>
......@@ -181,9 +179,9 @@
<option value="$PROJECT_DIR$/circle/network/urls.py" />
<option value="$PROJECT_DIR$/circle/openstack_api/neutron.py" />
<option value="$PROJECT_DIR$/circle/network/forms.py" />
<option value="$PROJECT_DIR$/circle/network/operations.py" />
<option value="$PROJECT_DIR$/circle/network/views.py" />
<option value="$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html" />
<option value="$PROJECT_DIR$/circle/network/operations.py" />
</list>
</option>
</component>
......@@ -254,12 +252,6 @@
<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="openstack_api" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
......@@ -273,7 +265,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="vmdetail&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;forms.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/forms.py&#10;urls.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;nova&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;neutron_p&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/neutron_policy.json&#10;operations&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base-d&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/confirm/base-delete.html&#10;indexvi&#9;null&#9;null&#10;vm-de&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html&#10;index-v&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;detailvi&#9;null&#9;null&#10;network&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail/network.html&#10;nova.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;operation&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;indev&#9;null&#9;null&#10;indexview&#9;null&#9;null&#10;operatio&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;vxlanc&#9;null&#9;null&#10;plain&#9;null&#9;null&#10;base.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;local&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/local.py&#10;views.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/views.py&#10;login.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/auth/login.html&#10;LoginVi&#9;null&#9;null&#10;indexv&#9;null&#9;null&#10;index-vm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;index.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;bas&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/base.py&#10;save&#9;null&#9;null&#10;plainc&#9;null&#9;null&#10;templatedet&#9;null&#9;null&#10;instancetemp&#9;null&#9;null&#10;instancetem&#9;null&#9;null&#10;url&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;vmcreate&#9;null&#9;null&#10;opera&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;templat&#9;null&#9;null&#10;vmadd&#9;null&#9;null&#10;addinterfa&#9;null&#9;null&#10;addin&#9;null&#9;null&#10;server&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;instance&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;operat&#9;null&#9;null&#10;ins&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;vmdetai&#9;null&#9;null" />
<property name="SearchEverywhereHistoryKey" value="operat&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/operations.py&#10;vxla&#9;null&#9;null&#10;network&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail/network.html&#10;vmdetail&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;forms.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/forms.py&#10;urls.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;nova&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;neutron_p&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/neutron_policy.json&#10;operations&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base-d&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/confirm/base-delete.html&#10;indexvi&#9;null&#9;null&#10;vm-de&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html&#10;index-v&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;detailvi&#9;null&#9;null&#10;nova.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;operation&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;indev&#9;null&#9;null&#10;indexview&#9;null&#9;null&#10;operatio&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;vxlanc&#9;null&#9;null&#10;plain&#9;null&#9;null&#10;base.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;local&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/local.py&#10;views.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/views.py&#10;login.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/auth/login.html&#10;LoginVi&#9;null&#9;null&#10;indexv&#9;null&#9;null&#10;index-vm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;index.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;bas&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/base.py&#10;save&#9;null&#9;null&#10;plainc&#9;null&#9;null&#10;templatedet&#9;null&#9;null&#10;instancetemp&#9;null&#9;null&#10;instancetem&#9;null&#9;null&#10;url&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;vmcreate&#9;null&#9;null&#10;opera&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;templat&#9;null&#9;null&#10;vmadd&#9;null&#9;null&#10;addinterfa&#9;null&#9;null&#10;addin&#9;null&#9;null&#10;server&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;instance&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;ins&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;vmdetai&#9;null&#9;null" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
......@@ -525,7 +517,7 @@
</properties>
</breakpoint>
</default-breakpoints>
<option name="time" value="347" />
<option name="time" value="350" />
</breakpoint-manager>
<watches-manager />
</component>
......@@ -963,14 +955,6 @@ certifi.where()</expression-string>
</state>
</provider>
</entry>
<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="219">
<caret line="27" column="34" lean-forward="false" selection-start-line="27" selection-start-column="34" selection-end-line="27" selection-end-column="34" />
<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="423">
......@@ -995,55 +979,65 @@ certifi.where()</expression-string>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html">
<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="108">
<caret line="32" column="21" lean-forward="true" selection-start-line="32" selection-start-column="21" selection-end-line="32" selection-end-column="21" />
<state relative-caret-position="66">
<caret line="784" column="39" lean-forward="false" selection-start-line="784" selection-start-column="39" selection-end-line="784" selection-end-column="39" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/views.py">
<entry file="file://$PROJECT_DIR$/circle/openstack_api/neutron.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="265">
<caret line="95" column="20" lean-forward="false" selection-start-line="95" selection-start-column="20" selection-end-line="95" selection-end-column="20" />
<state relative-caret-position="202">
<caret line="1384" column="4" lean-forward="false" selection-start-line="1384" selection-start-column="4" selection-end-line="1384" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.virtualenvs/cloud/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py">
<entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="66">
<caret line="784" column="39" lean-forward="false" selection-start-line="784" selection-start-column="39" selection-end-line="784" selection-end-column="39" />
<state relative-caret-position="52">
<caret line="89" column="0" lean-forward="false" selection-start-line="89" selection-start-column="0" selection-end-line="89" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/neutron.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="202">
<caret line="1384" column="4" lean-forward="false" selection-start-line="1384" selection-start-column="4" selection-end-line="1384" selection-end-column="4" />
<state relative-caret-position="1088">
<caret line="88" column="29" lean-forward="false" selection-start-line="88" selection-start-column="29" selection-end-line="88" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/common/operations.py">
<entry file="file://$PROJECT_DIR$/circle/network/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="52">
<caret line="89" column="0" lean-forward="false" selection-start-line="89" selection-start-column="0" selection-end-line="89" selection-end-column="0" />
<state relative-caret-position="180">
<caret line="1040" column="28" lean-forward="false" selection-start-line="1040" selection-start-column="28" selection-end-line="1040" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="58" column="63" lean-forward="false" selection-start-line="58" selection-start-column="63" selection-end-line="58" selection-end-column="63" />
<state relative-caret-position="448">
<caret line="57" column="15" lean-forward="false" selection-start-line="57" selection-start-column="15" selection-end-line="57" selection-end-column="47" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="431">
<caret line="54" column="29" lean-forward="false" selection-start-line="54" selection-start-column="29" selection-end-line="54" selection-end-column="29" />
<folding>
<element signature="n#style#0;n#tr#0;n#table#0;n#div#1;n#div#3;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
......@@ -48,7 +48,14 @@
</div>
<div class="col-sm-6">
<h3 class="pull-right"><small>{% trans "connected virtual machines" %}</small></h3>
<div class="clearfix"></div>
<table class="table">
{% for vm in vms %}
<tr style="text-align: right">
<td>{{ vm.name }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %}
......@@ -106,11 +106,6 @@ class VxlanDelete(LoginRequiredMixin, OperationView): #TODO: check user
def get_object(self, queryset=None):
return openstack_api.neutron.network_get(self.request, self.kwargs['pk'], expand_subnet=True)
def delete(self, request, *args, **kwargs):
response = super(VxlanDelete, self).delete(request, *args, **kwargs)
messages.success(request, _(u"Vxlan successfully deleted."))
return response
network_ops = OrderedDict([
('network_delete', VxlanDelete),
])
......@@ -1030,11 +1025,20 @@ class VxlanDetail(LoginRequiredMixin, SuccessMessageMixin, DetailView): #TODO: c
'isDhcpEnabled': subnet.enable_dhcp if subnet else False,
})
all_ports = openstack_api.neutron.port_list(self.request)
ports = [p for p in all_ports if p.network_id == self.object.id]
vm_ids = [p.device_id for p in ports if p.device_owner == "compute:nova"]
vms = []
for vm_id in vm_ids:
vms.append(openstack_api.nova.server_get(self.request, vm_id))
context['isMultipleSubnetsAvailable'] = len(self.object.subnets) > 1
context['isSubnetMissing'] = len(self.object.subnets) < 1
context['vm_list'] = () #SmallVmTable(self.object.vm_interface.all())
context['vm_list'] = ()
context['form'] = form
context['op'] = {i.op: i for i in ops}
context['vms'] = vms
return context
class VxlanCreate(LoginRequiredMixin, FormView):
......
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