Re: Writing list of dictionaries to CSV

2015-05-05 Thread Kashif Rana
at 9:09:40 PM UTC+4, Kashif Rana wrote: Hello Experts When I am writing list of dictionaries to CSV file, the key 'schedule' has value 'Mar 2012' becomes Mar-12. I really do not have clue why thats happening. Below is the code. dic_1 = {'action': 'permit', 'dst-address': 'maxprddb-scan

Writing list of dictionaries to CSV

2015-05-05 Thread Kashif Rana
Hello Experts When I am writing list of dictionaries to CSV file, the key 'schedule' has value 'Mar 2012' becomes Mar-12. I really do not have clue why thats happening. Below is the code. dic_1 = {'action': 'permit', 'dst-address': 'maxprddb-scan-167, maxprddb-scan-168, maxprddb-scan-169',

Python re to extract useful information from each line

2015-04-29 Thread Kashif Rana
Hello Experts I have below lines with some variations. 1- set policy id 1000 from Untrust to Trust Any 1.1.1.1 HTTP nat dst ip 10.10.10.10 port 8000 permit log 2- set policy id 5000 from Trust to Untrust Any microsoft.com HTTP nat src permit schedule 14August2014 log 3- set policy id 7000

Re: Python re to extract useful information from each line

2015-04-29 Thread Kashif Rana
On Thursday, April 30, 2015 at 12:42:18 AM UTC+4, Kashif Rana wrote: Hello Experts I have below lines with some variations. 1- set policy id 1000 from Untrust to Trust Any 1.1.1.1 HTTP nat dst ip 10.10.10.10 port 8000 permit log 2- set policy id 5000 from Trust to Untrust Any

Re: Python Script to convert firewall rules

2014-12-13 Thread Kashif Rana
On Saturday, December 13, 2014 6:31:34 AM UTC+4, Jason Friedman wrote: Thanks for the reply. Yes I can make the all possible keywords/values for both formate. But after that what gonna be the logic to convert one format to other format. Like to convert one line below are the keywords:

Re: Python Script to convert firewall rules

2014-12-13 Thread Kashif Rana
Hi Jason Thank you very much. Appreciated ! But the first requirement was to convert format1 to format2 as below: set interface ethernet2/5 ip 10.17.10.1/24 (format 1) set interfaces ge-0/0/0 unit 0 family inet address 10.17.10.1/24 (format 2) (set, interface, ip) = (set, interfaces, family inet

Re: Python Script to convert firewall rules

2014-12-11 Thread Kashif Rana
Hi Jason Thanks for the reply. Yes I can make the all possible keywords/values for both formate. But after that what gonna be the logic to convert one format to other format. Like to convert one line below are the keywords: set interface ethernet2/5 ip 10.17.10.1/24 (format 1) set interfaces

Python Script to convert firewall rules

2014-12-10 Thread Kashif Rana
Hello Experts I am network engineer and not expert in programming. I would like to make one python script to convert juniper netscreen firewall configuration into juniper SRX firewall configuration. Sample is below. I would appreciate if anybody can give me the high level steps to start with.