Merge remote-tracking branch 'origin/v2.1'

This commit is contained in:
Adolfo Gómez García 2017-05-09 09:42:18 +02:00
commit 58d0f10eb0
4 changed files with 28 additions and 14 deletions

View File

@ -44,7 +44,7 @@ from uds.services.OVirt.OVirtProvider import Provider as oVirtProvider
import logging import logging
import os import os
__updated__ = '2017-05-05' __updated__ = '2017-05-09'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -93,18 +93,25 @@ class BaseSpiceTransport(Transport):
tooltip=_('If checked, viewer will be shown on fullscreen mode-'), tooltip=_('If checked, viewer will be shown on fullscreen mode-'),
tab=gui.ADVANCED_TAB tab=gui.ADVANCED_TAB
) )
enableUsbShare = gui.CheckBoxField( smartCardRedirect = gui.CheckBoxField(
order=6, order=6,
label=_('Smartcard Redirect'), label=_('Smartcard Redirect'),
tooltip=_('If checked, SPICE protocol will allow smartcard redirection.'), tooltip=_('If checked, SPICE protocol will allow smartcard redirection.'),
defvalue=gui.FALSE, defvalue=gui.FALSE,
tab=gui.ADVANCED_TAB tab=gui.ADVANCED_TAB
) )
smartCardRedirect = gui.CheckBoxField( usbShare = gui.CheckBoxField(
order=7, order=7,
label=_('USB Auto Sharing'), label=_('USB'),
tooltip=_('If checked, viewer will allow usb auto sharing.'), tooltip=_('If checked, USB redirection will be allowed.'),
defvalue=gui.TRUE, defvalue=gui.FALSE,
tab=gui.ADVANCED_TAB
)
autoNewUsbShare = gui.CheckBoxField(
order=7,
label=_('New USB Auto Sharing'),
tooltip=_('Auto-redirect USB devices when plugged in.'),
defvalue=gui.FALSE,
tab=gui.ADVANCED_TAB tab=gui.ADVANCED_TAB
) )

View File

@ -8,7 +8,7 @@ import six
import os import os
__updated__ = '2017-05-05' __updated__ = '2017-05-09'
TEMPLATE = '''[virt-viewer] TEMPLATE = '''[virt-viewer]
@ -22,7 +22,7 @@ title={title}:%d - Press SHIFT+F12 to Release Cursor
enable-smartcard={smartcard} enable-smartcard={smartcard}
enable-usb-autoshare={usb_auto_share} enable-usb-autoshare={usb_auto_share}
delete-this-file={delete_file} delete-this-file={delete_file}
usb-filter=-1,-1,-1,-1,{usb_auto_share} usb-filter=-1,-1,-1,-1,{new_usb_auto_share}
tls-ciphers=DEFAULT tls-ciphers=DEFAULT
host-subject={host_subject} host-subject={host_subject}
ca={ca} ca={ca}
@ -46,6 +46,7 @@ class RemoteViewerFile(object):
smartcard = False smartcard = False
usb_auto_share = True usb_auto_share = True
new_usb_auto_share = False
delete_file = True delete_file = True
@ -74,6 +75,7 @@ class RemoteViewerFile(object):
smartcard = '01'[self.smartcard] smartcard = '01'[self.smartcard]
delete_file = '01'[self.delete_file] delete_file = '01'[self.delete_file]
usb_auto_share = '01'[self.usb_auto_share] usb_auto_share = '01'[self.usb_auto_share]
new_usb_auto_share = '01'[self.new_usb_auto_share]
ca = self.ca.strip().replace('\n', '\\\\n') # So we get '\\n' and script works fine after replacement ca = self.ca.strip().replace('\n', '\\\\n') # So we get '\\n' and script works fine after replacement
@ -87,6 +89,7 @@ class RemoteViewerFile(object):
title=self.title, title=self.title,
smartcard=smartcard, smartcard=smartcard,
usb_auto_share=usb_auto_share, usb_auto_share=usb_auto_share,
new_usb_auto_share=new_usb_auto_share,
delete_file=delete_file, delete_file=delete_file,
host_subject=self.host_subject if self.tls_port != -1 else '', host_subject=self.host_subject if self.tls_port != -1 else '',
ca=ca if tls_port != -1 else '', ca=ca if tls_port != -1 else '',

View File

@ -39,7 +39,7 @@ from .RemoteViewerFile import RemoteViewerFile
import logging import logging
__updated__ = '2017-05-05' __updated__ = '2017-05-09'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -58,7 +58,8 @@ class SPICETransport(BaseSpiceTransport):
# fixedPassword = BaseSpiceTransport.fixedPassword # fixedPassword = BaseSpiceTransport.fixedPassword
serverCertificate = BaseSpiceTransport.serverCertificate serverCertificate = BaseSpiceTransport.serverCertificate
fullScreen = BaseSpiceTransport.fullScreen fullScreen = BaseSpiceTransport.fullScreen
enableUsbShare = BaseSpiceTransport.enableUsbShare usbShare = BaseSpiceTransport.usbShare
autoNewUsbShare = BaseSpiceTransport.autoNewUsbShare
smartCardRedirect = BaseSpiceTransport.smartCardRedirect smartCardRedirect = BaseSpiceTransport.smartCardRedirect
def getUDSTransportScript(self, userService, transport, ip, os, user, password, request): def getUDSTransportScript(self, userService, transport, ip, os, user, password, request):
@ -73,7 +74,8 @@ class SPICETransport(BaseSpiceTransport):
secure_port = -1 if secure_port is None else secure_port secure_port = -1 if secure_port is None else secure_port
r = RemoteViewerFile(con['address'], port, secure_port, con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=self.fullScreen.isTrue()) r = RemoteViewerFile(con['address'], port, secure_port, con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=self.fullScreen.isTrue())
r.usb_auto_share = self.enableUsbShare.isTrue() r.usb_auto_share = self.usbShare.isTrue()
r.new_usb_auto_share = self.autoNewUsbShare.isTrue()
r.smartcard = self.smartCardRedirect.isTrue() r.smartcard = self.smartCardRedirect.isTrue()
m = tools.DictAsObj({ m = tools.DictAsObj({

View File

@ -47,7 +47,7 @@ import logging
import random import random
import string import string
__updated__ = '2017-05-05' __updated__ = '2017-05-09'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -67,7 +67,8 @@ class TSPICETransport(BaseSpiceTransport):
serverCertificate = BaseSpiceTransport.serverCertificate serverCertificate = BaseSpiceTransport.serverCertificate
fullScreen = BaseSpiceTransport.fullScreen fullScreen = BaseSpiceTransport.fullScreen
enableUsbShare = BaseSpiceTransport.enableUsbShare usbShare = BaseSpiceTransport.usbShare
autoNewUsbShare = BaseSpiceTransport.autoNewUsbShare
smartCardRedirect = BaseSpiceTransport.smartCardRedirect smartCardRedirect = BaseSpiceTransport.smartCardRedirect
def initialize(self, values): def initialize(self, values):
@ -91,7 +92,8 @@ class TSPICETransport(BaseSpiceTransport):
sshHost, sshPort = self.tunnelServer.value.split(':') sshHost, sshPort = self.tunnelServer.value.split(':')
r = RemoteViewerFile('127.0.0.1', '{port}', '{secure_port}', con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=self.fullScreen.isTrue()) r = RemoteViewerFile('127.0.0.1', '{port}', '{secure_port}', con['ticket']['value'], self.serverCertificate.value, con['cert_subject'], fullscreen=self.fullScreen.isTrue())
r.usb_auto_share = self.enableUsbShare.isTrue() r.usb_auto_share = self.usbShare.isTrue()
r.new_usb_auto_share = self.autoNewUsbShare.isTrue()
r.smartcard = self.smartCardRedirect.isTrue() r.smartcard = self.smartCardRedirect.isTrue()
m = tools.DictAsObj({ m = tools.DictAsObj({