<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python tool for exporting/importing a policy package or parts of it in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/67842#M4129</link>
    <description>&lt;P&gt;Hi friend, im having the same issue you solved adding the two lines on the export_package.py, but when i run the script receive this message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File "/home/admin/ExportImportPolicyPackage-master/exporting/export_package.py", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;reload(sys)&lt;BR /&gt;NameError: name 'sys' is not defined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is after I modify the export_package.py adding your suggested lines to the beginning to this script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2019 19:38:12 GMT</pubDate>
    <dc:creator>Antonio_Rodrigu</dc:creator>
    <dc:date>2019-11-19T19:38:12Z</dc:date>
    <item>
      <title>Re: Python tool for exporting/importing a policy package or parts of it</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41102#M3860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also having problems while exporting package:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Login failed: APIResponse received a response which is not valid JSON.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using Python:&lt;/P&gt;&lt;P&gt;Python 2.7.9 (default, Mar&amp;nbsp; 1 2015, 12:57:24)&lt;/P&gt;&lt;P&gt;[GCC 4.9.2] on linux2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Against R80 - Build 101&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 10:49:52 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41102#M3860</guid>
      <dc:creator>Jaime_Gonzalez_</dc:creator>
      <dc:date>2017-01-24T10:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting/importing a policy package or parts of it</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41103#M3861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have to enable access to the API from external PCs... (settings --&amp;gt; blade --&amp;gt; API)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If after that it works.. please tell me your sintax.. because I still have problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Jan 2017 18:10:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41103#M3861</guid>
      <dc:creator>Carlos_Molina</dc:creator>
      <dc:date>2017-01-24T18:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting/importing a policy package or parts of it</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41104#M3862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Carlos, that worked for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i'm facing another error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UnicodeEncodeError: 'ascii' codec can't encode character u'\u0431' in position 43: ordinal not in range(128)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That i hope is related to any unusual character on a policy object name, or to the encoding used on mi linux client. &lt;/P&gt;&lt;P&gt;I'll write here if i find how to solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax i used is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;python export_package.py -m 192.168.10.213 "2016-Septiembre01_1"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where "2016-Septiembre01_1", is the access layer (policy) name i got from running "show packages", like the "Standard" one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2017 08:07:55 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41104#M3862</guid>
      <dc:creator>Jaime_Gonzalez_</dc:creator>
      <dc:date>2017-01-25T08:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting/importing a policy package or parts of it</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41105#M3863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, &lt;/P&gt;&lt;P&gt;Solved the previous problem by adding:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; reload(sys)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sys.setdefaultencoding('utf8')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To the beggining of &lt;SPAN style="color: #333333;"&gt;export_package.py&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Now lets see how i import it on the R80 management, as the python version is 2.7.3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /opt/CPsuite-R80/fw1/Python/bin/python -V&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Python 2.7.3&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jan 2017 08:49:47 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41105#M3863</guid>
      <dc:creator>Jaime_Gonzalez_</dc:creator>
      <dc:date>2017-01-25T08:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting/importing a policy package or parts of it</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41106#M3864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally it works after instsalling jumbo take 76&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 13:00:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/41106#M3864</guid>
      <dc:creator>Carlos_Molina</dc:creator>
      <dc:date>2017-01-26T13:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Python tool for exporting/importing a policy package or parts of it</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/67842#M4129</link>
      <description>&lt;P&gt;Hi friend, im having the same issue you solved adding the two lines on the export_package.py, but when i run the script receive this message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;File "/home/admin/ExportImportPolicyPackage-master/exporting/export_package.py", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;reload(sys)&lt;BR /&gt;NameError: name 'sys' is not defined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is after I modify the export_package.py adding your suggested lines to the beginning to this script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 19:38:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Re-Python-tool-for-exporting-importing-a-policy-package-or-parts/m-p/67842#M4129</guid>
      <dc:creator>Antonio_Rodrigu</dc:creator>
      <dc:date>2019-11-19T19:38:12Z</dc:date>
    </item>
  </channel>
</rss>

