Merge branch 'rc-0.14.3' of github.com:blockstack/blockstack-core into rc-0.14.3

This commit is contained in:
Aaron Blankstein
2017-06-29 18:15:33 -04:00
3 changed files with 23 additions and 5 deletions

View File

@@ -4263,9 +4263,8 @@ def cli_sign_profile( args, config_path=CONFIG_PATH, proxy=None, password=None,
if res is None:
return {'error': 'Failed to sign and serialize profile'}
if BLOCKSTACK_DEBUG:
# sanity check
assert storage.parse_mutable_data(res, pubkey)
# sanity check
assert storage.parse_mutable_data(res, pubkey)
return res
@@ -5121,7 +5120,7 @@ def cli_datastore_listdir(args, config_path=CONFIG_PATH, interactive=False ):
def cli_datastore_stat(args, config_path=CONFIG_PATH, interactive=False ):
"""
command: datastore_stat advanced
help: Stat a file or directory in the datastore
help: Stat a file or directory in the datastore, returning only the header for files but returning the entire listing for directories.
arg: blockchain_id (str) 'The ID of the datastore owner'
arg: datastore_id (str) 'The datastore ID'
arg: path (str) 'The path to the file or directory to stat'

View File

@@ -1334,6 +1334,7 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
if inode_type == 'files':
if path is not None:
log.debug("Will run cli_datastore_getfile()")
res = internal.cli_datastore_getfile(blockchain_id, datastore_id, path, include_extended, force, device_ids, app_public_keys, config_path=self.server.config_path)
if 'error' not in res:
@@ -1342,6 +1343,7 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
res['inode_info']['inode']['idata'] = base64.b64encode(res['inode_info']['inode']['idata'])
else:
log.debug("Will run cli_datastore_getinode()")
res = internal.cli_datastore_getinode(blockchain_id, datastore_id, inode_uuid, include_extended, idata, force, device_ids, app_public_keys, config_path=self.server.config_path)
if 'error' not in res and idata:
@@ -1351,14 +1353,19 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
elif inode_type == 'directories':
if path is not None:
log.debug("Will run cli_datastore_listdir()")
res = internal.cli_datastore_listdir(blockchain_id, datastore_id, path, include_extended, force, device_ids, app_public_keys, config_path=self.server.config_path)
else:
log.debug("Will run cli_datastore_getinode()")
res = internal.cli_datastore_getinode(blockchain_id, datastore_id, inode_uuid, include_extended, idata, force, device_ids, app_public_keys, config_path=self.server.config_path)
else:
# inodes
if path is not None:
log.debug("Will run cli_datastore_stat()")
res = internal.cli_datastore_stat(blockchain_id, datastore_id, path, include_extended, force, device_ids, app_public_keys, config_path=self.server.config_path)
else:
log.debug("Will run cli_datastore_getinode()")
res = internal.cli_datastore_getinode(blockchain_id, datastore_id, inode_uuid, include_extended, idata, force, device_ids, app_public_keys, config_path=self.server.config_path)
if json_is_error(res):
@@ -1373,9 +1380,15 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
self.wfile.write(res)
else:
if BLOCKSTACK_TEST:
log.debug("Reply {}".format(json.dumps(res)))
self._reply_json(res)
else:
if BLOCKSTACK_TEST:
log.debug("Reply {}".format(json.dumps(res)))
self._reply_json(res)
return
@@ -2616,6 +2629,11 @@ class BlockstackAPIEndpointHandler(SimpleHTTPRequestHandler):
return self._send_headers(status_code=200, content_type='text/plain')
elif command == 'clearcache':
# clear the cache
data.cache_evct_all()
return self._send_headers(status_code=200, content_type='text/plain')
else:
return self._send_headers(status_code=401, content_type='text/plain')

View File

@@ -3519,6 +3519,7 @@ def nodejs_setup():
tmpdir = tempfile.mkdtemp()
atexit.register(nodejs_cleanup, tmpdir)
os.system("cd '{}' && npm install babel-cli babel-preset-es2015".format(tmpdir))
print "Node install at {}".format(tmpdir)
return tmpdir
@@ -3553,7 +3554,7 @@ def nodejs_run_test( testdir, test_name="core-test" ):
"""
Run a nodejs test
"""
rc = os.system('cd "{}" && npm run {} 2>&1 | tee /dev/stderr | egrep "^npm ERR"'.format(testdir, test_name))
rc = os.system('cd "{}" && npm install && npm run {} 2>&1 | tee /dev/stderr | egrep "^npm ERR"'.format(testdir, test_name))
if rc == 0:
raise Exception("Test {} failed".format(test_name))