Skip to content

Commit

Permalink
Fixes #7 sort pkg output alpha by doc[_id], and each doc key in alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
rfarley3 committed Aug 5, 2016
1 parent 0056183 commit 05b8f10
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kibana/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,12 @@ def write_pkg_to_file(self, name, objects, path='.'):
pkg_objs = []
for _, obj in iteritems(objects):
pkg_objs.append(obj)
output = self.json_dumps(pkg_objs) + '\n'
output = self.json_dumps(sorted(pkg_objs, key=lambda k: k['_id'])) + '\n'
filename = self.safe_filename('Pkg', name)
filename = os.path.join(path, filename)
self.pr_inf("Writing to file: " + filename)
with open(filename, 'w') as f:
f.write(output)
# self.pr_dbg("Contents: " + output)
return filename

def get_objects(self, search_field, search_val):
Expand Down

0 comments on commit 05b8f10

Please sign in to comment.