Skip to content

Commit

Permalink
Issue #51 Config information not accessible without authentication
Browse files Browse the repository at this point in the history
v2:
fixed make check-local errors

v1:
This patch fetches the config information
without need for authentication

Signed-off-by: Pooja Kulkarni <[email protected]>
  • Loading branch information
Pooja Kulkarni authored and danielhb committed Apr 12, 2016
1 parent aefb27b commit ec5c9d8
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 2 deletions.
19 changes: 19 additions & 0 deletions gingers390x.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ enable = True
# Root URI for Ginger s390x APIs
uri = "/plugins/gingers390x"

[/config]
tools.trailing_slash.on = False
tools.nocache.on = True
tools.proxy.on = True
tools.sessions.on = True
tools.sessions.name = 'wok'
tools.sessions.secure = True
tools.sessions.httponly = True
tools.sessions.locking = 'explicit'
tools.sessions.storage_type = 'ram'
tools.sessions.timeout = 10
tools.wokauth.on = False

[/]
tools.trailing_slash.on = False
request.methods_with_bodies = ('POST', 'PUT')
Expand All @@ -23,3 +36,9 @@ tools.wokauth.on = True
tools.staticdir.on = True
tools.staticdir.dir = wok.config.PluginPaths('gingers390x').ui_dir + '/pages/help'
tools.nocache.on = True

[/images]
tools.staticdir.on: True
tools.staticdir.dir: wok.config.PluginPaths('gingers390x').ui_dir + '/images'
tools.wokauth.on: False
tools.nocache.on: False
20 changes: 18 additions & 2 deletions model/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Ginger S390x
#
# Copyright IBM Corp, 2015
# Copyright IBM Corp, 2015-2016
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -17,9 +17,25 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

model_PYTHON = *.py
model_PYTHON = $(filter-out config.py, $(wildcard *.py))

nodist_model_PYTHON = config.py

EXTRA_DIST = config.py.in

modeldir = $(pythondir)/wok/plugins/gingers390x/model

install-data-local:
$(MKDIR_P) $(DESTDIR)$(modeldir)

do_substitution = \
sed -e 's,[@]gingers390xversion[@],$(PACKAGE_VERSION),g' \
-e 's,[@]gingers390xrelease[@],$(PACKAGE_RELEASE),g'

config.py: config.py.in Makefile
$(do_substitution) < $(srcdir)/config.py.in > config.py

BUILT_SOURCES = config.py
CLEANFILES = config.py
$(models_PYTHON:%.py=%.pyc) \
$(NULL)
31 changes: 31 additions & 0 deletions model/config.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Project Ginger S390x
#
# Copyright IBM Corp, 2016
#
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA


__version__ = "@gingers390xversion@"
__release__ = "@gingers390xrelease@"


class ConfigModel(object):
def __init__(self, **kargs):
pass

def lookup(self, name):
return {'version': "-".join([__version__, __release__])}

0 comments on commit ec5c9d8

Please sign in to comment.