Aric, Daniel, Team, Thank you for the great effort! Aric managed to whip up a quick PoC in no time. I mentioned your demo in the conference's closing town-hall. Daniel managed to test it and come up with updated code to allow it to scale. Georg gave us the lead on the jcopy. I appreciate everyone's interest, suggestions and contributions. I learned a few things that will hopefully help me improve for the next challenge.
I'd be interested in hearing if people have any thoughts on how we could have done this better or faster. Thanks and looking forward to seeing everyone next time! -Mark Shostak From: opnfv-tech-discuss@lists.opnfv.org [mailto:opnfv-tech-discuss@lists.opnfv.org] On Behalf Of daniel.balsi...@swisscom.com Sent: Thursday, January 16, 2020 07:25 To: opnfv-tech-discuss@lists.opnfv.org Subject: [opnfv-tech-discuss] Fw: PDF->AS v0.3 Sorry, forgot the mailinglist. KR D ________________________________ From: Balsiger Daniel, INI-EAI-INO <daniel.balsi...@swisscom.com<mailto:daniel.balsi...@swisscom.com>> Sent: Thursday, January 16, 2020 12:16 PM To: SHOSTAK, MARK <ms7...@att.com<mailto:ms7...@att.com>> Subject: Re: PDF->AS v0.3 Maybe the attachment was truncated I try to rename the file to pdftoas.py -> pdftoas.txt ________________________________ From: Balsiger Daniel, INI-EAI-INO <daniel.balsi...@swisscom.com<mailto:daniel.balsi...@swisscom.com>> Sent: Thursday, January 16, 2020 12:09 PM To: SHOSTAK, MARK <ms7...@att.com<mailto:ms7...@att.com>> Subject: Re: PDF->AS v0.3 Hi Mark The file is attached, since inline email formatting was not very handy. It should be clear how other data than IPMI password could be modified. Best Regards, Daniel As a last comment: Only having the PDF as input is definitely not enough to create the whole treasuremap tree. (e.g. no IP addresses contained in PDF, but required for treasuremap tree) ________________________________ From: SHOSTAK, MARK <ms7...@att.com<mailto:ms7...@att.com>> Sent: Wednesday, January 15, 2020 5:40 PM To: Balsiger Daniel, INI-EAI-INO <daniel.balsi...@swisscom.com<mailto:daniel.balsi...@swisscom.com>> Subject: PDF->AS v0.2 import sys import ruamel.yaml import yaml ryaml = ruamel.yaml.YAML() ryaml.preserve_quotes = True ryaml.indent(mapping=4, sequence=6, offset=4) ryaml.explicit_start = True ############################### # Source PDF pdf = "pod18.yaml" # set PDF filename here with open(pdf) as f: pdf_data = yaml.safe_load(f) ########################## # Generic template # # # Extract datum from PDF # # target_data = pdf_data['jumphost']['remote_params']['pass'] # ############## # Target # # #Target file # target_file = "treasuremap_path_and_filename.yaml" # # with open(target_file, 'r+') as tf: # target_yaml_struct = ryaml.load(f) # # #The password in the ipmi_admin_password.yaml file is called "data" a bit confusing... # target_yaml_struct['target_object'] = target_data # # with open(target_file, 'w') as tf: # ryaml.dump(target_file, tf) # ############################### # Extract datum from PDF target_data = pdf_data['jumphost']['remote_params']['pass'] ############## # Target #Target file target_file = "ipmi_admin_password.yaml" with open(target_file, 'r+') as tf: target_yaml_struct = ryaml.load(f) #The password in the ipmi_admin_password.yaml file is called "data" a bit confusing... target_yaml_struct['data'] = target_data with open(target_file, 'w') as tf: ryaml.dump(target_data, tf)
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#23844): https://lists.opnfv.org/g/opnfv-tech-discuss/message/23844 Mute This Topic: https://lists.opnfv.org/mt/69750706/21656 Group Owner: opnfv-tech-discuss+ow...@lists.opnfv.org Unsubscribe: https://lists.opnfv.org/g/opnfv-tech-discuss/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-