From 2b507520a7b4984d7020a6d5153d29350a24a9a9 Mon Sep 17 00:00:00 2001
From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date: Wed, 11 Mar 2020 01:49:07 +0100
Subject: [PATCH] pyhoca/cli/frontend.py: Fix reference before assignment error
 in resume_session() method. Thanks to Randy Goldenberg for spotting this.
 (Fixes: #1445).

---
# debian/changelog       | 5 ++++-
 pyhoca/cli/frontend.py | 3 +--
 2 files changed, 5 insertions(+), 3 deletions(-)

#diff --git a/debian/changelog b/debian/changelog
#index e17aed8..f4e4f2d 100644
#--- a/debian/changelog
#+++ b/debian/changelog
#@@ -1,6 +1,9 @@
# pyhoca-cli (0.6.1.3-0x2go1) UNRELEASED; urgency=medium
# 
#-  * Continue development
#+  [ Mike Gabriel ]
#+  * pyhoca/cli/frontend.py: Fix reference before assignment error in
#+    resume_session() method. Thanks to Randy Goldenberg for spotting
#+    this. (Fixes: #1445).
# 
#  -- X2Go Release Manager <git-admin@x2go.org>  Thu, 26 Dec 2019 17:03:42 +0100
# 
diff --git a/pyhoca/cli/frontend.py b/pyhoca/cli/frontend.py
index e970dca..7551838 100644
--- a/pyhoca/cli/frontend.py
+++ b/pyhoca/cli/frontend.py
@@ -226,8 +226,7 @@ class PyHocaCLI(x2go.X2GoClient):
         """
         # resume a running session
         self.logger('resuming X2Go session: %s' % self.args.resume, loglevel=x2go.loglevel_INFO, )
-        if available_sessions is None:
-            available_sessions = self._X2GoClient__list_sessions(s_hash)
+        available_sessions = self._X2GoClient__list_sessions(s_hash)
         if available_sessions and self.args.resume == 'OLDEST':
             self._auto_resume_oldest(s_hash)
         elif available_sessions and self.args.resume == 'NEWEST':
-- 
2.20.1
