added organization code and removed from periods from logs

This commit is contained in:
crp3844
2022-09-08 09:27:50 -04:00
parent 7be43da4c0
commit fddaf8ac15

View File

@@ -444,12 +444,20 @@ if __name__ == "__main__":
os.environ["BW_SESSION"] = bitwarden_session_key
# export to csv and json
logger.info("Exporting vault to both CSV and JSON files.")
logger.debug("Exporting vault to CSV.")
logger.info("Exporting vault to both CSV and JSON files")
logger.debug("Exporting vault to CSV")
logger.debug((subprocess.run([bitwarden_cli_executable, 'export', '--output', os.path.join(script_directory, 'export.csv') , '--format', 'csv'], capture_output=True).stdout).decode())
logger.debug("Exporting vault to JSON.")
logger.debug("Exporting vault to JSON")
logger.debug((subprocess.run([bitwarden_cli_executable, 'export', '--output', os.path.join(script_directory, 'export.json'), '--format', 'json'], capture_output=True).stdout).decode())
# looking for Organizations
# look for organizations
logger.info("Looking for Organizations")
bitwarden_organizations = json.loads(((subprocess.run([bitwarden_cli_executable, 'organizations'], capture_output=True)).stdout).decode())
print(bitwarden_organizations)
logger.info("Found {} Organiztaions.".format())
else:
logger.error("Unable to unlock vault, please check vault password")
else: