Skip to content

Commit

Permalink
Update Ginger base configuration according to recent changes on Wok
Browse files Browse the repository at this point in the history
The application name and sub_nodes are restricted for the application
configuration and should never be edited. In that case, it is good to
remove this kind of information from a configuration file.

According to the recent changes on Wok, the application name will be the plugin
name with the first letter in uppercase. And the sub_nodes automatically
imported from control module.

Signed-off-by: Aline Manera <[email protected]>
  • Loading branch information
alinefm authored and danielhb committed Jan 24, 2016
1 parent 3b3cc2d commit 38ac060
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Ginger Base
#
# 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,5 +17,5 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

from wok.plugins.gingerbase.gingerbase import GingerBase
__all__ = [GingerBase]
from wok.plugins.gingerbase.gingerbase import Gingerbase
__all__ = [Gingerbase]
5 changes: 3 additions & 2 deletions gingerbase.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[wok]
# Enable Ginger base plugin on Wok server (values: True|False)
enable = True
plugin_class = "GingerBase"

# Root URI for Ginger base APIs
uri = "/plugins/gingerbase"
extra_auth_api_class = "control.sub_nodes"

[/]
tools.trailing_slash.on = False
Expand Down
6 changes: 3 additions & 3 deletions gingerbase.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Ginger Base
#
# 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 @@ -27,7 +27,7 @@
from wok.root import WokRoot


class GingerBase(WokRoot):
class Gingerbase(WokRoot):
def __init__(self, wok_options):
make_dirs = [
os.path.dirname(os.path.abspath(config.get_object_store())),
Expand All @@ -45,7 +45,7 @@ def __init__(self, wok_options):
self.model = gingerBaseModel.Model()

dev_env = wok_options.environment != 'production'
super(GingerBase, self).__init__(self.model, dev_env)
super(Gingerbase, self).__init__(self.model, dev_env)

for ident, node in sub_nodes.items():
setattr(self, ident, node(self.model))
Expand Down
6 changes: 2 additions & 4 deletions tests/test_config.py.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Project Ginger Base
#
# Copyright IBM, Corp. 2014-2015
# Copyright IBM, Corp. 2014-2016
#
# Code derived from Project Kimchi
#
Expand Down Expand Up @@ -81,10 +81,8 @@ class ConfigTests(unittest.TestCase):
pluginPrefix = paths.add_prefix(paths.plugin_dir)
configObj = {
'wok': {
'plugin_class': 'GingerBase',
'enable': True,
'uri': '/plugins/gingerbase',
'extra_auth_api_class': 'control.sub_nodes'
'uri': '/plugins/gingerbase'
},
'/': {
'tools.trailing_slash.on': False,
Expand Down

0 comments on commit 38ac060

Please sign in to comment.