From 029708f1091e152714582a7aed3961375ab328a3 Mon Sep 17 00:00:00 2001 From: bpuchala Date: Tue, 27 Feb 2018 23:51:03 -0500 Subject: [PATCH 1/2] get username fix --- prisms_jobs/__init__.py | 2 +- prisms_jobs/misc.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/prisms_jobs/__init__.py b/prisms_jobs/__init__.py index 8192bf1..c63cb3f 100644 --- a/prisms_jobs/__init__.py +++ b/prisms_jobs/__init__.py @@ -14,7 +14,7 @@ def __str__(self): from prisms_jobs.job import Job from prisms_jobs.jobdb import JobDB, JobDBError, EligibilityError, complete_job, error_job -__version__ = '4.0.0' +__version__ = '4.0.dev0' __all__ = [ 'Job', 'JobDB', diff --git a/prisms_jobs/misc.py b/prisms_jobs/misc.py index 359a561..f1418f2 100644 --- a/prisms_jobs/misc.py +++ b/prisms_jobs/misc.py @@ -4,6 +4,7 @@ import datetime import os +import pwd import subprocess import sys @@ -61,11 +62,9 @@ def run(cmd, input=None, stdin=None, encoding=None): def getlogin(): """Returns os.getlogin(), else os.environ["LOGNAME"], else "?" """ try: - return os.getlogin() - except OSError: - return os.environ["LOGNAME"] - else: - return "?" + return pwd.getpwuid(os.getuid())[0] + except: + return os.environ.get("LOGNAME","?") def seconds(walltime): """Convert [[[DD:]HH:]MM:]SS to hours""" From 90ee2389a465b4ae50155d0466dd67ff727c0416 Mon Sep 17 00:00:00 2001 From: bpuchala Date: Wed, 28 Feb 2018 09:17:54 -0500 Subject: [PATCH 2/2] version bump to 4.0.1 --- README.md | 4 ++-- conda-recipes/prisms_jobs/meta.yaml | 4 ++-- doc/source/conf.py | 2 +- doc/source/install.rst | 4 ++-- prisms_jobs/__init__.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9f9403c..6222828 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ If installing to a user directory, you may need to set your PATH to find the ins git clone https://github.com/prisms-center/prisms_jobs.git cd prisms_jobs -2. Checkout the branch/tag containing the version you wish to install. Latest is ``v4.0.0``: +2. Checkout the branch/tag containing the version you wish to install. Latest is ``v4.0.1``: - git checkout v4.0.0 + git checkout v4.0.1 2. From the root directory of the repository: diff --git a/conda-recipes/prisms_jobs/meta.yaml b/conda-recipes/prisms_jobs/meta.yaml index 393350b..fb70e4a 100644 --- a/conda-recipes/prisms_jobs/meta.yaml +++ b/conda-recipes/prisms_jobs/meta.yaml @@ -1,9 +1,9 @@ package: name: prisms-jobs - version: "4.0.0" + version: "4.0.1" source: - git_rev: v4.0.0 + git_rev: v4.0.1 git_url: https://github.com/prisms-center/prisms_jobs.git requirements: diff --git a/doc/source/conf.py b/doc/source/conf.py index dbce178..3a57aa0 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -86,7 +86,7 @@ # The short X.Y version. version = u'4.0' # The full version, including alpha/beta/rc tags. -release = u'4.0.0' +release = u'4.0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/source/install.rst b/doc/source/install.rst index be78e8f..abc063f 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -45,11 +45,11 @@ Install from source git clone https://github.com/prisms-center/prisms_jobs.git cd prisms_jobs -2. Checkout the branch/tag containing the version you wish to install. Latest is ``v4.0.0``: +2. Checkout the branch/tag containing the version you wish to install. Latest is ``v4.0.1``: :: - git checkout v4.0.0 + git checkout v4.0.1 3. From the root directory of the repository: diff --git a/prisms_jobs/__init__.py b/prisms_jobs/__init__.py index c63cb3f..cce2d03 100644 --- a/prisms_jobs/__init__.py +++ b/prisms_jobs/__init__.py @@ -14,7 +14,7 @@ def __str__(self): from prisms_jobs.job import Job from prisms_jobs.jobdb import JobDB, JobDBError, EligibilityError, complete_job, error_job -__version__ = '4.0.dev0' +__version__ = '4.0.1' __all__ = [ 'Job', 'JobDB',