Revision 88329243
b/snf-cyclades-app/synnefo/helpdesk/templates/helpdesk/networks_list.html | ||
---|---|---|
47 | 47 |
<td>{{ nic.updated }}</td> |
48 | 48 |
<td>{{ nic.index }}</td> |
49 | 49 |
<td>{{ nic.mac }}</td> |
50 |
<td>{{ nic.ipv4 }}</td> |
|
50 |
<td>{{ nic.ipv4_address }}</td>
|
|
51 | 51 |
<td>{{ nic.ipv6 }}</td> |
52 | 52 |
<td>{{ nic.get_firewall_profile_display }} ({{nic.firewall_profile}})</td> |
53 | 53 |
</tr> |
b/snf-cyclades-app/synnefo/helpdesk/templates/helpdesk/vms_list.html | ||
---|---|---|
83 | 83 |
<td>{{ nic.updated }}</td> |
84 | 84 |
<td>{{ nic.index }}</td> |
85 | 85 |
<td>{{ nic.mac }}</td> |
86 |
<td>{{ nic.ipv4 }}</td> |
|
87 |
<td>{{ nic.ipv6 }}</td> |
|
86 |
<td>{{ nic.ipv4_address }}</td>
|
|
87 |
<td>{{ nic.ipv6_address }}</td>
|
|
88 | 88 |
<td>{{ nic.get_firewall_profile_display }} ({{nic.firewall_profile}})</td> |
89 | 89 |
</tr> |
90 | 90 |
{% empty %} |
b/snf-cyclades-app/synnefo/helpdesk/templatetags/helpdesk_tags.py | ||
---|---|---|
10 | 10 |
address |
11 | 11 |
""" |
12 | 12 |
try: |
13 |
return vm.nics.filter(network__public=True)[0].ipv4 |
|
13 |
return vm.nics.filter(network__public=True)[0].ipv4_address
|
|
14 | 14 |
except IndexError: |
15 | 15 |
return "No public ip" |
16 | 16 |
|
b/snf-cyclades-app/synnefo/helpdesk/tests.py | ||
---|---|---|
111 | 111 |
vm2u2 = mfactory.VirtualMachineFactory(userid=USER2, name="user2 vm2", |
112 | 112 |
pk=1003) |
113 | 113 |
|
114 |
netpub = mfactory.NetworkFactory(public=True) |
|
115 |
net1u1 = mfactory.NetworkFactory(public=False, userid=USER1) |
|
116 |
|
|
117 |
nic1 = mfactory.NetworkInterfaceFactory(machine=vm1u2, network=net1u1) |
|
118 |
nic2 = mfactory.NetworkInterfaceFactory(machine=vm1u1, network=netpub, |
|
119 |
ipv4="195.251.222.211") |
|
114 |
nic1 = mfactory.NetworkInterfaceFactory(machine=vm1u2, |
|
115 |
userid=vm1u2.userid, |
|
116 |
network__public=False, |
|
117 |
network__userid=USER1) |
|
118 |
ip2 = mfactory.IPv4AddressFactory(nic__machine=vm1u1, |
|
119 |
userid=vm1u1.userid, |
|
120 |
network__public=True, |
|
121 |
network__userid=None, |
|
122 |
address="195.251.222.211") |
|
120 | 123 |
|
121 | 124 |
def test_enabled_setting(self): |
122 | 125 |
settings.HELPDESK_ENABLED = False |
b/snf-cyclades-app/synnefo/helpdesk/views.py | ||
---|---|---|
46 | 46 |
import astakosclient |
47 | 47 |
from snf_django.lib import astakos |
48 | 48 |
|
49 |
from synnefo.db.models import VirtualMachine, NetworkInterface, Network
|
|
49 |
from synnefo.db.models import VirtualMachine, IPAddress, Network
|
|
50 | 50 |
|
51 | 51 |
# server actions specific imports |
52 | 52 |
from synnefo.api import util |
... | ... | |
185 | 185 |
|
186 | 186 |
if is_ip: |
187 | 187 |
try: |
188 |
nic = NetworkInterface.objects.filter(ipv4=search_query).exclude(
|
|
189 |
machine__deleted=True).get()
|
|
190 |
search_query = nic.machine.userid
|
|
188 |
ip = IPAddress.objects.filter(address=search_query, deleted=False)\
|
|
189 |
.get()
|
|
190 |
search_query = ip.userid
|
|
191 | 191 |
is_uuid = True |
192 |
except NetworkInterface.DoesNotExist:
|
|
192 |
except IPAddress.DoesNotExist:
|
|
193 | 193 |
account_exists = False |
194 | 194 |
account = None |
195 | 195 |
|
Also available in: Unified diff