<?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 policies.SecurityRule().clone?? in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/policies-securityrule-clone/m-p/352332#M2459</link>
    <description>&lt;P&gt;I'm having a terrible time trying to just simply 'clone' a security rule, and then edit it how desired, without running into issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, using copy.deepcopy(security_rule) works perfectly...however adds a massive amount of run-time to my program. I previously used this method on dictionaries without a major increase in run-time. I can't find any existing clone/duplicate/etc type of function within the API, if it exists.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've tried using element(), element_str(), __dict__, manually converting to dict, I've tried manually grabbing all the params that are allowed when creating a new rule via a dict (ie SecurityRule(**dict))...and spent hours running into misc issue after issue. Either rules not getting added correctly, or rules still somehow magically linked (old vs new rule) even when creating a brand new one via **dict. The linkage then causes the old rule to get modified when only attempting to modify the new rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's got to be a simple way to do this. I'm hoping someone can help me out here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Sat, 26 Sep 2020 04:07:29 GMT</pubDate>
    <dc:creator>rgillespie01</dc:creator>
    <dc:date>2020-09-26T04:07:29Z</dc:date>
    <item>
      <title>policies.SecurityRule().clone??</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/policies-securityrule-clone/m-p/352332#M2459</link>
      <description>&lt;P&gt;I'm having a terrible time trying to just simply 'clone' a security rule, and then edit it how desired, without running into issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, using copy.deepcopy(security_rule) works perfectly...however adds a massive amount of run-time to my program. I previously used this method on dictionaries without a major increase in run-time. I can't find any existing clone/duplicate/etc type of function within the API, if it exists.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've tried using element(), element_str(), __dict__, manually converting to dict, I've tried manually grabbing all the params that are allowed when creating a new rule via a dict (ie SecurityRule(**dict))...and spent hours running into misc issue after issue. Either rules not getting added correctly, or rules still somehow magically linked (old vs new rule) even when creating a brand new one via **dict. The linkage then causes the old rule to get modified when only attempting to modify the new rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's got to be a simple way to do this. I'm hoping someone can help me out here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 04:07:29 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/policies-securityrule-clone/m-p/352332#M2459</guid>
      <dc:creator>rgillespie01</dc:creator>
      <dc:date>2020-09-26T04:07:29Z</dc:date>
    </item>
  </channel>
</rss>

