Permalink
Browse files

settling branches

  • Loading branch information...
1 parent cbfcf9d commit 9e4faa20916e6d8d1eb01c6a4508d32f4b4ab207 @ypodim committed Apr 9, 2012
Showing with 5 additions and 3 deletions.
  1. +3 −1 agents.py
  2. +2 −2 db.py
View
@@ -457,18 +457,20 @@ def api_clear_context(self):
parser = OptionParser(add_help_option=False)
parser.add_option("-h", "--host", dest="host", default='')
parser.add_option("-p", "--port", dest="port", default='10007')
+ parser.add_option("-d", "--dbno", dest="dbno", default='0')
(options, args) = parser.parse_args()
HOST = options.host
PORT = int(options.port)
+ dbno = int(options.dbno)
satellite_url = 'http://localhost:22222'
mode = ''
if settings['debug']:
mode = '(debug)'
- db = DB()
+ db = DB(dbno)
print 'Ego agent running at %s:%s using %s' % (HOST,PORT,mode)
View
4 db.py
@@ -11,8 +11,8 @@ def getKV (context, key): return 'profile:%s:key:%s:values' % (conte
def getKVA(context, key, val): return 'profile:%s:key:%s:val:%s:agents' % (context, key, val)
class DB:
- def __init__(self):
- self.r = redis.Redis(host='localhost', port=6379, db=0)
+ def __init__(self, db=0):
+ self.r = redis.Redis(host='localhost', port=6379, db=db)
def generate_secret(self, username):
secret = ''

0 comments on commit 9e4faa2

Please sign in to comment.