From f7ab045626ced984daefc7467f691f285141bb04 Mon Sep 17 00:00:00 2001
From: Yasin
Date: Mon, 6 Oct 2014 15:18:16 +0200
Subject: [PATCH] Tools: ple,nitos slicename dynamic + iotlab username dynamic.
TODO:PLE resource names dynamic
---
portal/slicetabexperiment.py | 7 ++++++-
portal/templates/slice-tab-experiment.html | 12 ++++--------
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/portal/slicetabexperiment.py b/portal/slicetabexperiment.py
index cca8afbd..b1020a16 100644
--- a/portal/slicetabexperiment.py
+++ b/portal/slicetabexperiment.py
@@ -18,6 +18,11 @@ class ExperimentView (FreeAccessView, ThemeView):
template_name = 'slice-tab-experiment.html'
def get (self, request, slicename, state=None):
+
+ username = self.request.user
- return render_to_response(self.template, { 'theme' : self.theme }, context_instance=RequestContext(request))
+ split_slicename = slicename.split('.')
+ ple_slicename = split_slicename[0] + '8' + split_slicename[1] + '_' + split_slicename[2]
+
+ return render_to_response(self.template, { 'theme' : self.theme,'slicename':slicename, 'ple_slicename':ple_slicename, 'username':username }, context_instance=RequestContext(request))
diff --git a/portal/templates/slice-tab-experiment.html b/portal/templates/slice-tab-experiment.html
index 4d58fe51..b6c7c5c4 100644
--- a/portal/templates/slice-tab-experiment.html
+++ b/portal/templates/slice-tab-experiment.html
@@ -9,13 +9,9 @@
on the reserved nodes. To access your slice on a resource just type the following command:
- $ ssh converted_slice_name@planetlab-resource.hostname.com
-
- You need to convert your typical slicename into a specific format in order to do SSH. An example below will demonstrate the conversion:
-
- Typical slice_name = onelab.upmc.mytestslice
- converted_slice_name = onelab8upmc_mytestslice
+ $ ssh {{ple_slicename}}@planetlab-resource.hostname.com
+ NOTE: Your typical slicename {{slicename}} has been converted to PlanetLab specific format {{ple_slicename}} in order to do SSH.
Please note that the first '.' is replaced by number 8 and the rest of the dot/s are replaced by underscore/s.
Be aware that after you reserve a PlanetLab Europe resource your slice will be deployed with a delay of about 15 minutes,
@@ -28,7 +24,7 @@
the following command:
- ssh onelab_username@fit3-dev.inrialpes.fr
+ ssh {{username}}@fit3-dev.inrialpes.fr
NITOS
@@ -38,7 +34,7 @@
The NITOS server address is nitlab.inf.uth.gr, so to connect to the NITOS server:
- $ ssh your_slice_name@nitlab.inf.uth.gr
+ $ ssh {{slicename}}@nitlab.inf.uth.gr
--
2.43.0