From 816c2b90b7adb8ce3e0d63ab2693233247776229 Mon Sep 17 00:00:00 2001 From: Johnathan Date: Mon, 23 Jul 2018 07:12:47 -0400 Subject: [PATCH 1/3] Python depends for telnet tls Addresses feature request in issue #1637 Installs py2-openssl as well as cryptography, pyasn1, and service_identity --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 27af6b2a3a..4b8411ecc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,13 +24,14 @@ FROM alpine MAINTAINER www.evennia.com # install compilation environment -RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev bash +RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev bash py2-openssl # add the project source ADD . /usr/src/evennia # install dependencies RUN pip install -e /usr/src/evennia --trusted-host pypi.python.org +RUN pip install cryptography pyasn1 service_identity # add the game source when rebuilding a new docker image from inside # a game dir From 4eb765f15549728ace30c2382ff4f7fc4ca72c51 Mon Sep 17 00:00:00 2001 From: "Aris (Karim) Merchant" Date: Mon, 23 Jul 2018 16:56:57 -0700 Subject: [PATCH 2/3] Add procps dependency to Dockerfile Certain evennia commands, such as the server command, rely upon ps to run correctly. Unfortunately, alpine uses the BusyBox ps command, which is somewhat idiosyncratic in its option handling. Adding the procps dependency installs a more standard ps command, allowing server maintenance commands to work correctly. This fixes #1635. For further background, see gliderlabs/docker-alpine#173. --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27af6b2a3a..97f410135f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ # install `docker` (http://docker.com) # # Usage: -# cd to a folder where you want your game data to be (or where it already is). +# cd to a folder where you want your game data to be (or where it already is). # # docker run -it -p 4000:4000 -p 4001:4001 -p 4005:4005 -v $PWD:/usr/src/game evennia/evennia -# -# (If your OS does not support $PWD, replace it with the full path to your current +# +# (If your OS does not support $PWD, replace it with the full path to your current # folder). # # You will end up in a shell where the `evennia` command is available. From here you @@ -24,7 +24,8 @@ FROM alpine MAINTAINER www.evennia.com # install compilation environment -RUN apk update && apk add python py-pip python-dev py-setuptools gcc musl-dev jpeg-dev zlib-dev bash +RUN apk update && apk add python py-pip python-dev py-setuptools gcc \ +musl-dev jpeg-dev zlib-dev bash procps # add the project source ADD . /usr/src/evennia @@ -33,7 +34,7 @@ ADD . /usr/src/evennia RUN pip install -e /usr/src/evennia --trusted-host pypi.python.org # add the game source when rebuilding a new docker image from inside -# a game dir +# a game dir ONBUILD ADD . /usr/src/game # make the game source hierarchy persistent with a named volume. From 1feceea4e81d1944de6355b53a23ed061eaa80fd Mon Sep 17 00:00:00 2001 From: "Aris (Karim) Merchant" Date: Mon, 30 Jul 2018 16:37:22 -0700 Subject: [PATCH 3/3] Change callability check TypeErrors are thrown in a wide variety of situations, most of which have nothing to do with calling an uncallable object. The appropriate test is to use the built-in callable() function, which actually tests if the object is callable. --- evennia/commands/cmdset.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/commands/cmdset.py b/evennia/commands/cmdset.py index c363f87f80..6f127da1c2 100644 --- a/evennia/commands/cmdset.py +++ b/evennia/commands/cmdset.py @@ -296,9 +296,9 @@ class CmdSet(with_metaclass(_CmdSetMeta, object)): result (any): An instantiated Command or the input unmodified. """ - try: + if callable(cmd): return cmd() - except TypeError: + else: return cmd def _duplicate(self):