Skip to content

Commit

Permalink
Merge pull request #141 from tmaeno/master
Browse files Browse the repository at this point in the history
Content-Type json <-> form-data
  • Loading branch information
tmaeno authored Jul 18, 2022
2 parents c90591c + 8927070 commit d761bd1
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
17 changes: 12 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
FROM docker.io/centos:7

ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

RUN yum update -y
RUN yum install -y epel-release
RUN yum install -y python3 python3-devel httpd httpd-devel gcc gridsite less git psmisc wget
RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
RUN yum install -y postgresql14
RUN yum clean all && rm -rf /var/cache/yum

RUN python3 -m venv /opt/panda
RUN /opt/panda/bin/pip install -U pip
RUN /opt/panda/bin/pip install -U setuptools
RUN /opt/panda/bin/pip install --no-cache-dir -U pip
RUN /opt/panda/bin/pip install --no-cache-dir -U setuptools
RUN adduser atlpan
RUN groupadd zp
RUN usermod -a -G zp atlpan
RUN mkdir /tmp/src
WORKDIR /tmp/src
COPY . .
RUN /opt/panda/bin/python setup.py sdist; /opt/panda/bin/pip install `ls dist/p*.tar.gz`[postgres]
RUN /opt/panda/bin/pip install rucio-clients
RUN /opt/panda/bin/pip install "git+https://github.com/PanDAWMS/panda-cacheschedconfig.git"
RUN /opt/panda/bin/python setup.py sdist; /opt/panda/bin/pip install --no-cache-dir `ls dist/p*.tar.gz`[postgres]
RUN /opt/panda/bin/pip install --no-cache-dir rucio-clients
RUN /opt/panda/bin/pip install --no-cache-dir "git+https://github.com/PanDAWMS/panda-cacheschedconfig.git"
RUN ln -s /opt/panda/lib/python*/site-packages/mod_wsgi/server/mod_wsgi*.so /etc/httpd/modules/mod_wsgi.so
WORKDIR /
RUN rm -rf /tmp/src

RUN mkdir -p /etc/panda
RUN mkdir -p /etc/idds
Expand Down
2 changes: 1 addition & 1 deletion PandaPkgInfo.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
release_version = "0.0.38"
release_version = "0.0.39"
6 changes: 6 additions & 0 deletions pandaserver/server/panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,12 @@ def application(environ, start_response):
# json
body = gzip.decompress(body)
params = json.loads(body)
# patch for True/False
for k in list(params):
if params[k] is True:
params[k] = 'True'
elif params[k] is False:
params[k] = 'False'
if panda_config.entryVerbose:
tmpLog.debug("with %s" % str(list(params)))
param_list = [dummyReq]
Expand Down
11 changes: 11 additions & 0 deletions pandaserver/srvcore/CoreUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,17 @@ def get_id_from_dn(dn, keep_proxy=False, keep_digits=True):
return get_bare_dn(dn, keep_proxy, keep_digits)


# resolve string bool
def resolve_bool(param):
if isinstance(param, bool):
return param
if param == 'True':
return True
if param == 'False':
return False
return param


# cached object
class CachedObject:
# constructor
Expand Down
Empty file modified pandaserver/taskbuffer/OraDBProxy.py
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions pandaserver/userinterface/UserIF.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pandaserver.jobdispatcher.Protocol as Protocol
import pandaserver.taskbuffer.ProcessGroups
from pandaserver.taskbuffer.WrappedPickle import WrappedPickle
from pandaserver.srvcore.CoreUtils import clean_user_id
from pandaserver.srvcore.CoreUtils import clean_user_id, resolve_bool
from pandaserver.brokerage.SiteMapper import SiteMapper
from pandaserver.taskbuffer import PrioUtil, JobUtils
from pandaserver.dataservice.DDM import rucioAPI
Expand Down Expand Up @@ -1119,7 +1119,6 @@ def _getWGwithPR(req):
return None



"""
web service interface
Expand Down Expand Up @@ -2586,7 +2585,8 @@ def relay_idds_command(req, command_name, args=None, kwargs=None, manager=None):
tmpLog.error(tmpStr)
return json.dumps((False, tmpStr))
try:
if manager is not True:
manager = resolve_bool(manager)
if not manager:
manager = False
if '+' in command_name:
command_name, idds_host = command_name.split('+')
Expand Down

0 comments on commit d761bd1

Please sign in to comment.