Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »


scp commit_permissions.py ansible@192.168.99.111:/var/db/scripts/commit/



vMX config
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


commit_
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()







  • No labels