|
|
@@ -1594,6 +1594,31 @@ def cmd_search(options, persona, objstr, cache): |
|
|
|
searches = [ (x[0], ) + tuple(x[1:].split('=', 1)) for x in args ] |
|
|
|
#_debprint(repr(searches)) |
|
|
|
|
|
|
|
if not searches: |
|
|
|
# just dump everything |
|
|
|
mdofile = aliased(orm.MetaDataObject) |
|
|
|
|
|
|
|
sel = select(mdofile.data).where( |
|
|
|
# we are operating on files |
|
|
|
mdofile.type == 'file') |
|
|
|
|
|
|
|
sel = sel.execution_options(yield_per=10) |
|
|
|
|
|
|
|
with objstr._ses() as session: |
|
|
|
r = ( x[0] for x in session.execute(sel) ) |
|
|
|
|
|
|
|
if _type == 'file': |
|
|
|
mapping = FileObject.prep_mapping( |
|
|
|
objstr.get_hostmappings()) |
|
|
|
r = ( x.get_lcl_name(mapping) for x in r ) |
|
|
|
else: |
|
|
|
raise ValueError('unhandled type: %s' % repr(_type)) |
|
|
|
|
|
|
|
for i in r: |
|
|
|
print(i) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
propmap = aliased(orm.PropertyMapping) |
|
|
|
|
|
|
|
# propobj only returns what can match query |
|
|
|