From f09a093b51120dbfb4e5a41a77f2c04a1cda5276 Mon Sep 17 00:00:00 2001
From: Kenny Sharma <kenny.sharma@tum.de>
Date: Mon, 6 Feb 2017 07:57:09 +0100
Subject: [PATCH] [hotfix] Add reservation support for launching CLE.

This patch updates the distributed NEST launcher to be in line with
the normal CLELauncher, which now requires a reservation parameter
to be passed into the init method.

Change-Id: Id6d52ea7b35b70205e35450e770cd45e9ccfc8a1
---
 .../hbp_nrp_music_interface/launch/MUSICLauncher.py        | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICLauncher.py b/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICLauncher.py
index be10adf..19bdce5 100644
--- a/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICLauncher.py
+++ b/hbp_nrp_music_interface/hbp_nrp_music_interface/launch/MUSICLauncher.py
@@ -20,7 +20,9 @@ class MUSICLauncher(object):
     requested brain processes.
     """
 
-    def __init__(self, exd_file, bibi_file, env_file, exp_path, server_host, sim_id, timeout):
+    # pylint: disable=too-many-arguments
+    def __init__(self, exd_file, bibi_file, env_file, exp_path, server_host, reservation,
+                 sim_id, timeout):
         """
         Store all experiment configuration parameters so that they can be propagated
         to the remote hosts.
@@ -30,6 +32,7 @@ class MUSICLauncher(object):
         :param env_file Absolute path to the simulation environment file.
         :param exp_path Absolute path to the base dir of the experiment files.
         :param server_host Target Gazebo/brain process host (e.g. local or lugano)
+        :param reservation Reservation string for cluster backend (None is a valid option)
         :param sim_id The id of the simulation/experiment to be launched.
         :param timeout The default simulation timeout (time initially allocated).
         """
@@ -39,6 +42,7 @@ class MUSICLauncher(object):
         self._env_file = env_file
         self._exp_path = exp_path
         self._server_host = server_host
+        self._reservation = reservation if reservation else ''
         self._sim_id = sim_id
         self._timeout = timeout
 
@@ -69,6 +73,7 @@ class MUSICLauncher(object):
                                       '--environment={}'.format(self._env_file),
                                       '--experiment-path={}'.format(self._exp_path),
                                       '--gzserver-host={}'.format(self._server_host),
+                                      '--reservation={}'.format(self._reservation),
                                       '--sim-id={}'.format(self._sim_id),
                                       '--timeout={}'.format(str(self._timeout).replace(' ', '_')),
                                       '--music'],
-- 
GitLab