This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from frankban/exterminate-mongo
Exterminate mongo
- Loading branch information
Showing
6 changed files
with
9 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
language: python | ||
|
||
services: | ||
- mongodb | ||
|
||
sudo: false | ||
|
||
before_install: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ Source: switchboard | |
Maintainer: Jay R. Wren <[email protected]> | ||
Section: python | ||
Priority: optional | ||
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7), python-formencode, python-pymongo, python-blinker, python-webob, python-mako, python-decorator, dh-python | ||
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7), python-formencode, python-sqlalchemy, python-blinker, python-webob, python-mako, python-decorator, dh-python | ||
Standards-Version: 3.9.1 | ||
|
||
Package: python-switchboard | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,13 +77,9 @@ Switchboard has only a handful of settings, none of which are required: | |
+------------------------------+-------------+--------------------------------+ | ||
| Key | Default | Description | | ||
+==============================+=============+================================+ | ||
| switchboard.mongo_host | localhost | The host for MongoDB. | | ||
| switchboard.dburl | | The db URL. | | ||
+------------------------------+-------------+--------------------------------+ | ||
| switchboard.mongo_port | 27017 | The port for MongoDB. | | ||
+------------------------------+-------------+--------------------------------+ | ||
| switchboard.mongo_db | switchboard | The database name. | | ||
+------------------------------+-------------+--------------------------------+ | ||
| switchboard.mongo_collection | switches | The collection name. | | ||
| switchboard.dbtable | switchboard | The DB table to use. | | ||
+------------------------------+-------------+--------------------------------+ | ||
| switchboard.internal_ips | | Comma-delimited list of IPs. | | ||
+------------------------------+-------------+--------------------------------+ | ||
|
@@ -106,13 +102,11 @@ argument can be omitted. | |
|
||
An example configuration that needs ``nested=True``:: | ||
|
||
switchboard.mongo_host=mongodb.example.org | ||
switchboard.mong_port=27018 | ||
switchboard.dburl=postgresql://user:[email protected]:5432/switches | ||
|
||
And one that does not need ``nested=True``:: | ||
|
||
mongo_host=mongodb.example.org | ||
mong_port=27018 | ||
dburl=postgresql://user:[email protected]:5432/switches | ||
|
||
The Admin UI | ||
^^^^^^^^^^^^ | ||
|
@@ -159,15 +153,15 @@ Caching | |
^^^^^^^ | ||
|
||
By default, switchboard will query all the switches every time one is checked. In | ||
many applications, this may be more mongo queries than desired. Switchboard supports | ||
many applications, this may be more queries than desired. Switchboard supports | ||
a cache system, e.g. via memcache:: | ||
|
||
import pylibmc | ||
|
||
memcache_client = pylibmc.Client(['127.0.0.1']) | ||
switchboard.configure(config, cache=memcache_client) | ||
|
||
This does require memcache to be running, but limits mongodb queries to only occur | ||
This does require memcache to be running, but limits queries to only occur | ||
after a switch is changed and the cache is invalidated. | ||
|
||
Custom cache objects can be used instead of a memcache client, to implement different caching | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters