Commit 396943df authored by Kostas Papadimitriou's avatar Kostas Papadimitriou Committed by Georgios D. Tsoukalas
Browse files

cyclades ui: Handle empty EXTRA_RDP_CONTENT setting

parent 30f5f787
......@@ -411,7 +411,7 @@ def machines_connect(request):
# rdp param is set, the user requested rdp file
# check if we are on windows
if operating_system == 'windows' and request.GET.get("rdp", False):
extra_rdp_content = ''
# UI sent domain info (from vm metadata) use this
# otherwise use our default snf-<vm_id> domain
EXTRA_RDP_CONTENT = getattr(settings, 'UI_EXTRA_RDP_CONTENT', '')
......@@ -419,13 +419,14 @@ def machines_connect(request):
extra_rdp_content = EXTRA_RDP_CONTENT(server_id, ip_address,
hostname, username)
else:
extra_rdp_content = EXTRA_RDP_CONTENT % \
{
'server_id': server_id,
'ip_address': ip_address,
'hostname': hostname,
'user': username
}
if EXTRA_RDP_CONTENT:
extra_rdp_content = EXTRA_RDP_CONTENT % \
{
'server_id': server_id,
'ip_address': ip_address,
'hostname': hostname,
'user': username
}
rdp_context = {
'username': username,
......
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 to comment