diff options
author | ramon <ramongomez@us.es> | 2017-01-12 10:14:27 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2017-01-12 10:14:27 +0000 |
commit | 65c738e06072a3cbfa8205b45ae105befeedb7cc (patch) | |
tree | 69d0665d1810285f50a9faf0109619f4da886187 | |
parent | 13e20adb275cc6bac6f3df323ce32e8ff6e5d13e (diff) |
#718: OGAgent soporta ejecutar script en sesión de usuario y pequeños cambios de información.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5145 a21b9725-9963-47de-94b9-378ad31fedc9
5 files changed, 19 insertions, 23 deletions
diff --git a/admin/Sources/Clients/ogagent/linux/debian/changelog b/admin/Sources/Clients/ogagent/linux/debian/changelog index 30efe006..01fd564d 100644 --- a/admin/Sources/Clients/ogagent/linux/debian/changelog +++ b/admin/Sources/Clients/ogagent/linux/debian/changelog @@ -1,12 +1,12 @@ -ogagent (1.0.0) stable; urgency=medium - - * Initial release for OpenGnsys Agent - - -- Adolfo Gómez García <agomez@virtualcable.es> Tue, 18 Jul 2015 03:18:22 +0200 - ogagent (1.1.0) stable; urgency=medium * Functional OpenGnsys Agent interacting with OpenGnsys Server 1.1.0 -- Ramón M. Gómez <ramongomez@us.es> Tue, 13 Oct 2016 17:00:00 +0200 +ogagent (1.0.0) stable; urgency=medium + + * Initial release for OpenGnsys Agent + + -- Adolfo Gómez García <agomez@virtualcable.es> Tue, 18 Jul 2015 03:18:22 +0200 + diff --git a/admin/Sources/Clients/ogagent/linux/debian/control b/admin/Sources/Clients/ogagent/linux/debian/control index e89e8dac..b5b75a01 100644 --- a/admin/Sources/Clients/ogagent/linux/debian/control +++ b/admin/Sources/Clients/ogagent/linux/debian/control @@ -1,7 +1,7 @@ Source: ogagent Section: admin Priority: optional -Maintainer: Adolfo Gómez García <agomez@virtualcable.es> +Maintainer: Ramón M. Gómez <ramongomez@us.es> Build-Depends: debhelper (>= 7), po-debconf Standards-Version: 3.9.2 Homepage: http://www.opengnsys.es diff --git a/admin/Sources/Clients/ogagent/linux/debian/copyright b/admin/Sources/Clients/ogagent/linux/debian/copyright index 8e5ceacd..18841449 100644 --- a/admin/Sources/Clients/ogagent/linux/debian/copyright +++ b/admin/Sources/Clients/ogagent/linux/debian/copyright @@ -1,6 +1,6 @@ Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 Name: ogagent -Maintainer: Adolfo Gómez García +Maintainer: Ramón M. Gómez Source: http://opengnsys.es Copyright: 2014 Virtual Cable S.L.U. diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py index 6e287be6..27e94db3 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py @@ -26,7 +26,7 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' -@author: Adolfo Gómez, dkmaster at dkmon dot com +@author: Ramón M. Gómez, ramongomez at us dot es ''' from __future__ import unicode_literals @@ -34,6 +34,7 @@ from opengnsys.workers import ClientWorker from opengnsys import operations from opengnsys.log import logger +from opengnsys.scriptThread import ScriptExecutorThread class OpenGnSysWorker(ClientWorker): name = 'opengnsys' @@ -44,12 +45,14 @@ class OpenGnSysWorker(ClientWorker): def onDeactivation(self): logger.debug('Deactivate invoked') - # Processes message "doit" (sample) - def process_doit(self, jsonParams): - logger.debug('Processed message doit with params {}'.format(jsonParams)) - self.sendServerMessage('doit', {'data':1}) + # Processes script execution + def process_script(self, jsonParams): + logger.debug('Processed message: script({})'.format(jsonParams)) + thr = ScriptExecutorThread(jsonParams['code']) + thr.start() + #self.sendServerMessage({'op', 'launched'}) def process_logoff(self, jsonParams): - logger.debug('Processed logoff message with params {}'.format(jsonParams)) + logger.debug('Processed message: logoff({})'.format(jsonParams)) operations.logoff() diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py index c15db967..8a72a03f 100644 --- a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py +++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py @@ -26,7 +26,7 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ''' -@author: Ramón M. Gómez, ramongomez at us dot es +@author: Ramón M. Gómez, ramongomez at us dot es ''' from __future__ import unicode_literals @@ -101,13 +101,6 @@ class OpenGnSysWorker(ServerWorker): logger.debug('onDeactivation') self.REST.sendMessage('ogagent/stopped', {'mac': self.interface.mac, 'ip': self.interface.ip, 'ostype': operations.osType, 'osversion': operations.osVersion}) - # Processes message "doit" (sample) - #def process_doit(self, path, getParams, postParams): - # # Send a sample message to client - # logger.debug('Processing doit') - # self.sendClientMessage('doit', {'param1': 'test', 'param2': 'test2'}) - # return 'Processed message for {}, {}, {}'.format(path, getParams, postParams) - def processClientMessage(self, message, data): logger.debug('Got OpenGnsys message from client: {}, data {}'.format(message, data)) @@ -218,7 +211,7 @@ class OpenGnSysWorker(ServerWorker): thr = ScriptExecutorThread(script) thr.start() else: - self.sendScriptMessage(script) + self.sendClientMessage('script', {'code': script}) return {'op': 'launched'} def process_logoff(self, path, getParams, postParams, server): |