summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2019-04-29 10:48:33 +0200
committerRamón M. Gómez <ramongomez@us.es>2019-04-29 10:48:33 +0200
commitfebf228ba327c38a04a013d9b0dbb7020fdcce21 (patch)
treefb05af5fb90fd5fb10d6f0d2f6c15fbde15fdbf2
parentb266c77276cf539a959d9714d7f1855b773ecc53 (diff)
#761: OGAGent checks for dobule slash before connecting to REST URL.
-rw-r--r--admin/Sources/Clients/ogagent/oglive/Makefile21
-rw-r--r--admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postinst.debhelper5
-rw-r--r--admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postrm.debhelper12
-rw-r--r--admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool6
-rw-r--r--admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool-startup10
-rw-r--r--admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py4
6 files changed, 6 insertions, 52 deletions
diff --git a/admin/Sources/Clients/ogagent/oglive/Makefile b/admin/Sources/Clients/ogagent/oglive/Makefile
index 832e2dc7..84e06107 100644
--- a/admin/Sources/Clients/ogagent/oglive/Makefile
+++ b/admin/Sources/Clients/ogagent/oglive/Makefile
@@ -30,28 +30,13 @@ install-ogagent:
cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys
cp -r $(SOURCEDIR)/cfg $(LIBDIR)/cfg
+ ln -fs $(LIBDIR)/cfg/ogagent.cfg $(CFGDIR)
+ ln -fs $(LIBDIR)/cfg/ogclient.cfg $(CFGDIR)
- # scripts
cp scripts/ogagent $(BINDIR)
- cp scripts/OGAgentTool-startup $(BINDIR)
- cp scripts/OGAgentTool $(BINDIR)
-
- # Fix permissions
chmod 755 $(BINDIR)/ogagent
- chmod 755 $(BINDIR)/OGAgentTool-startup
- chmod 600 $(LIBDIR)/cfg/ogagent.cfg
-
- # If for red hat based, copy init.d
-ifeq ($(DISTRO),rh)
- mkdir -p $(INITDIR)
- cp debian/ogagent.init $(INITDIR)/ogagent
- chmod +x $(INITDIR)/ogagent
- ln -fs /usr/share/OGAgent/cfg/ogagent.cfg $(CFGDIR)
- ln -fs /usr/share/OGAgent/cfg/ogclient.cfg $(CFGDIR)
-endif
- # chmod 0755 $(BINDIR)/ogagent
uninstall:
rm -rf $(LIBDIR)
- # rm -f $(BINDIR)/ogagent
+ rm -f $(BINDIR)/ogagent
rm -rf $(CFGDIR)
diff --git a/admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postinst.debhelper b/admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postinst.debhelper
deleted file mode 100644
index e75924dc..00000000
--- a/admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postinst.debhelper
+++ /dev/null
@@ -1,5 +0,0 @@
-# Automatically added by dh_installinit
-if [ -x "/etc/init.d/ogagent" ]; then
- update-rc.d ogagent defaults >/dev/null || exit $?
-fi
-# End automatically added section
diff --git a/admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postrm.debhelper b/admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postrm.debhelper
deleted file mode 100644
index 3167f1f8..00000000
--- a/admin/Sources/Clients/ogagent/oglive/debian/ogagent-oglive.postrm.debhelper
+++ /dev/null
@@ -1,12 +0,0 @@
-# Automatically added by dh_installinit
-if [ "$1" = "purge" ] ; then
- update-rc.d ogagent remove >/dev/null
-fi
-
-
-# In case this system is running systemd, we make systemd reload the unit files
-# to pick up changes.
-if [ -d /run/systemd/system ] ; then
- systemctl --system daemon-reload >/dev/null || true
-fi
-# End automatically added section
diff --git a/admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool b/admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool
deleted file mode 100644
index 5b300523..00000000
--- a/admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-FOLDER=/usr/share/OGAgent
-
-cd $FOLDER
-python OGAgentUser.py $@
diff --git a/admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool-startup b/admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool-startup
deleted file mode 100644
index bb3a848e..00000000
--- a/admin/Sources/Clients/ogagent/oglive/scripts/OGAgentTool-startup
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# Simple hack to wait for systray to be present
-# Exec tool if not already runned by session manager
-ps -ef | grep "$USER" | grep -v grep | grep -v OGAgentTool-startup | grep 'OGAgentTool' -q
-# If not already running
-if [ $? -eq 1 ]; then
- sleep 5
- exec /usr/bin/OGAgentTool
-fi \ No newline at end of file
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 8aed2a8b..e740bbf0 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
@@ -123,6 +123,8 @@ class OpenGnSysWorker(ServerWorker):
# Replacing server IP if its running on ogLive client
logger.debug('Activating on ogLive client, new server is {}'.format(os.environ['oglive']))
url = parse.urlsplit(url)._replace(netloc=os.environ['oglive']).geturl()
+ if not url.endswith(os.path.sep):
+ url += os.path.sep
self.REST = REST(url)
# Get network interfaces until they are active or timeout (5 minutes)
for t in range(0, 300):
@@ -176,7 +178,7 @@ class OpenGnSysWorker(ServerWorker):
self.access_token = response['access_token']
self.refresh_token = response['refresh_token']
# Once authenticated with the server, change the API URL for private request
- self.REST = REST(url + '/api/private')
+ self.REST = REST(url + 'api/private')
# Set authorization tokens in the REST object, so in each request this token will be used
self.REST.set_authorization_headers(self.access_token, self.refresh_token)
# Create HTML file (TEMPORARY)