Skip to content
This repository has been archived by the owner on Nov 19, 2017. It is now read-only.

Commit

Permalink
Update to version 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joente committed Mar 9, 2017
1 parent 8cbb0ce commit 7a35075
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 3 additions & 1 deletion ChangeLog-2.0.2
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
* Fixed handling the buffer_path argument. (issue #5)

* Fixed error message when an invalid server_name is used. (issue #6)
* Fixed error message when an invalid server_name is used. (issue #6)

* Update siridb-connector and qpack
2 changes: 2 additions & 0 deletions build_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

CHANGELOG_FILE = 'ChangeLog'


def _get_changelog(version):
with open('ChangeLog-{}'.format(version), 'r') as f:
content = f.read()
return content


def _get_distribution():
'''Returns distribution code name. (Ubuntu)'''
proc = subprocess.Popen(['lsb_release', '-c'], stdout=subprocess.PIPE)
Expand Down
21 changes: 13 additions & 8 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
local_siridb_info = None
remote_siridb_info = None


def check_valid_dbname(dbname):
if not isinstance(dbname, str):
raise ValueError(
Expand Down Expand Up @@ -103,9 +104,9 @@ def create_database(
'w',
encoding='utf-8') as f:
f.write(DEFAULT_CONFIG.format(
comment_buffer_path=
'# ' if _config['buffer_path'] == dbpath else '',
**_config))
comment_buffer_path='# '
if _config['buffer_path'] == dbpath else '',
**_config))

db_obj = [
1, # shema version
Expand Down Expand Up @@ -425,7 +426,9 @@ def join_database():

db = menu(
title='Database',
options=Options([{'option': str(i), 'text': s} for i, s in enumerate(remote_siridb_info.dblist)]),
options=Options([
{'option': str(i), 'text': s}
for i, s in enumerate(remote_siridb_info.dblist)]),
default='0')
dbname = remote_siridb_info.dblist[int(db)]

Expand Down Expand Up @@ -524,13 +527,15 @@ def create_joined_database(dbpath, buffer_path, pool, new_pool, action_str):
new_pool,
allow_retry=True)


def get_time_precision(s):
_map = ['s', 'ms', 'us', 'ns']
return _map.index(s)


def get_duration(tp, duration):
return duration if isinstance(duration, int) else DURATIONS[duration][0] * (1000**tp)
return duration if isinstance(duration, int) \
else DURATIONS[duration][0] * (1000**tp)


def create_and_register_server(dbname,
Expand Down Expand Up @@ -597,7 +602,7 @@ def rollback(*args):
1,
'All servers must have status {!r} '
'before we can continue. As least {!r} has status {!r}'
.format(expected, srv[0], srv[1]));
.format(expected, srv[0], srv[1]))

asyncio.get_event_loop().run_until_complete(load_database(
dbpath,
Expand Down Expand Up @@ -830,7 +835,8 @@ def form_create_new_database():
]),
default='ms')

duration_options = [{'option': k, 'text': v[1]} for k, v in DURATIONS.items()]
duration_options = [
{'option': k, 'text': v[1]} for k, v in DURATIONS.items()]

duration_num = menu(
title='Number (float and integer) sharding duration',
Expand Down Expand Up @@ -975,7 +981,6 @@ def parse_create_replica_or_pool(args):
else:
pool = len(result['pools'])


dbconfig = siri.query('show {}'.format(','.join(DBPROPS)))
except Exception as e:
quit_manage(1, e)
Expand Down

0 comments on commit 7a35075

Please sign in to comment.