Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...


Code Block
titlevMX config
collapsetrue
vagrant@vqfx-re# show
commit {
    file commit_permissions.py;
}
language python;


set system scripts commit file commit_permissions.py
system scripts commit file commit_permissions.py
set system scripts language python




Code Block
titlecommit_
collapsetrue
from junos import Junos
from junos import Junos_Context
from junos import Junos_Configuration
import jcs

def main():
    # Get configuration root object
    root = Junos_Configuration

    message = "Permission all is assigned to invalid class."

    # Warn about any login classes with the all permission set
    for element in root.findall("./system/login/class[permissions='all']"):
        jcs.emit_warning("class:" + element.find('name').text + " " + message)

if __name__ == '__main__':
    main()


...