PaloAltoNetworks / PaloAltoNetworks/pan-os-python

Performing a push to Shared using panos panorama gives error PanDeviceXapiError: commit-all is missing 'commit-all'

Open
#514 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
400
Forks
199
PR merge metrics
No merged PRs in 30d

Description

Hi All,

I'm trying to create a shared address object using panos.panorama. However I'm not able to proceed with pushing the configuration to the firewalls. I could create objects within device groups and push them successfully to the firewalls under the device group, but I haven't been successful with shared yet. Below is my code.

from panos.panorama import Panorama
from panos.objects import AddressObject

if __name__ == "__main__":
    panorama = "10.0.0.1"
    username = "USERNAME"
    password = "PASSWORD"

    pano = Panorama(panorama,username, password)
    obj = AddressObject("Sample_Shared_Object", "1.1.1.1")
    pano.add(obj)
    obj.create()

    pano.commit_all(sync=True, sync_all=True)

I'm getting the error on line pano.commit_all(sync=True, sync_all=True)

Exception has occurred: PanDeviceXapiError
 commit-all  is missing 'commit-all'
pan.xapi.PanXapiError:  commit-all  is missing 'commit-all'

During handling of the above exception, another exception occurred:

  File "C:\palo_alto_python_panos_scripts\Address_Objects\createAddressObjectInShared.py", line 47, in <module>
    pano.commit_all(sync=True, sync_all=True)
panos.errors.PanDeviceXapiError:  commit-all  is missing 'commit-all'

This line was suggested on issue #256 by btorresgil (https://github.com/PaloAltoNetworks/pan-os-python/issues/256). Do you know what I might be missing? arielpa-tr's solution in #256 seem to have used panorama.PanoramaCommitAll() and device group names. Would it be possible to use commit_all() without defining the device group names?

I also tried to add a panorama commit before the commit_all (pano.commit(sync=True, sync_all=True)), but I'm still getting the error on the pano.commit_all() line.

Any help would be appreciated. Thank you.

Environment:

  • Panorama version: 10.2.3
  • pan-os-python version: 1.8.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with panos.panorama.Panorama.commit_all() and reproduce the provided shared-object script against the stated Panorama and pan-os-python versions. Compare its behavior with the PanoramaCommitAll() and device-group approach referenced in issue #256; done means shared configuration can be pushed without the reported missing 'commit-all' error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.