Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0a3d40e0
authored
7 years ago
by
Szabolcs Gelencser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show connected vms of network
parent
2c453601
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
7 deletions
+18
-7
.idea/workspace.xml
+0
-0
circle/network/templates/network/vxlan-edit.html
+8
-1
circle/network/views.py
+10
-6
No files found.
.idea/workspace.xml
View file @
0a3d40e0
This diff is collapsed.
Click to expand it.
circle/network/templates/network/vxlan-edit.html
View file @
0a3d40e0
...
...
@@ -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 %}
This diff is collapsed.
Click to expand it.
circle/network/views.py
View file @
0a3d40e0
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
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