Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.109 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.78; '*S*': 0.00; 'interfaces': 0.04; 'subject:Python': 0.06; 'cc:addr:python-list': 0.11; 'address)': 0.16; 'variable': 0.18; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'appreciated': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'becoming': 0.31; 'interface': 0.32; 'maybe': 0.34; 'convert': 0.35; 'equal': 0.35; 'requirement': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'interface,': 0.36; 'much.': 0.36; 'should': 0.36; 'unit': 0.37; 'thank': 0.38; 'list,': 0.38; 'manually': 0.60; 'first': 0.61; 'address': 0.63; 'interest': 0.64; 'to:addr:gmail.com': 0.65; 'contact': 0.67; 'below:': 0.68; 'subject': 0.69; 'family': 0.73 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DHS2JKYRuzkGZL9Y2BTJ2ws+zDlreOkp08g5BMfbS6A=; b=VcEVpytybQWwDGjHVv0pjmPMEibPHdkSz+bBNCQ2XUMF7XIs1ZuQj1e/8rjimcbdZC icrgNVW5dOkEWiHzg2T3Iq724IQVlX36G7DLYB8abAy7yvT7+8TkNkNUwE9qFRHwE3xf PTEjVkVsYfS6xy3ODo8lwbKqkpxxiQXRghcNoxfyV1O4zZhsfYtJlpGFFjiVRJ+XtvoO A8EeR6i+LCDuCnnFYwCs2yUhVHOwp2cVhX1ynuTWn4BYB6tavmfTQePLGzMIV2rT76sX EwYvokFHZynA7op0Ve+6NLcJQcNQqzbEsfnZ2RnlHERNgXQ57LmoyiPqM4OU7IBa66qk 4+GA== MIME-Version: 1.0 X-Received: by 10.194.104.137 with SMTP id ge9mr46922852wjb.135.1418620073680; Sun, 14 Dec 2014 21:07:53 -0800 (PST) In-Reply-To: References: Date: Sun, 14 Dec 2014 22:07:53 -0700 Subject: Re: Python Script to convert firewall rules From: Jason Friedman To: Kashif Rana Content-Type: text/plain; charset=UTF-8 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 13 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1418620081 news.xs4all.nl 2885 [2001:888:2000:d::a6]:58258 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 43675159 X-Received-Bytes: 4164 Xref: csiph.com comp.lang.python:82545 > 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 address) > But some values are variable and should ask the user to convert manually > like ethernet2/5 equal to ge-0/0/0 or ge-0/0/1 or ge-0/0/2 > And some values keep as it is like 10.17.10.1/24 Kashif, perhaps you should contact me off list, this subject is becoming very particular and maybe not of interest to the general audience.