MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / execute

Method execute

keepercommander/commands/record.py:1861–1879  ·  view source on GitHub ↗
(self, params, **kwargs)

Source from the content-addressed store, hash-verified

1859 return list_sf_parser
1860
1861 def execute(self, params, **kwargs):
1862 fmt = kwargs.get('format', 'table')
1863 pattern = kwargs['pattern'] if 'pattern' in kwargs else None
1864 results = api.search_shared_folders(params, pattern or '')
1865 if kwargs.get('roe_eligible'):
1866 results = [sf for sf in results
1867 if vault_extensions.shared_folder_has_pam_user_with_rotation(params, sf.shared_folder_uid)]
1868 if any(results):
1869 table = []
1870 headers = ['shared_folder_uid', 'name'] if fmt == 'json' else ['Shared Folder UID', 'Name']
1871 for sf in results:
1872 row = [sf.shared_folder_uid, sf.name]
1873 table.append(row)
1874 table.sort(key=lambda x: (x[1] or '').lower())
1875
1876 return base.dump_report_data(table, headers, fmt=fmt, filename=kwargs.get('output'),
1877 row_number=True)
1878 else:
1879 return handle_empty_result(fmt, 'No shared folders are found', kwargs.get('output'))
1880
1881
1882class RecordListTeamCommand(Command):

Calls 2

handle_empty_resultFunction · 0.85
getMethod · 0.80