Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
John_Fleming
Advisor

Python script to install all policies on a MDS.

Hi all, I'm working a project to get a largish MDS env up to R80.40. I took a moment to play around with the python SDK and put it on github. In the env in question I'm really only worried about failures so the output is really just error messages but should someone want to tweak it this should give you a good starting point.

The script does the following (ok now I need to update the comments again)

  • Get a list of domains (CMAs)
  • Get a list of policy packages
    • Shows how to deal with packages returning 50 items
  • Get policy install targets
    • Skips package targets set to all
  • Try and install
    • If detects there is a policy install in progress it will try again in 10 seconds until the sun burns out.
  • Get the details of the policy install
  • write output in CSV format using the following format (hopefully properly escaped for CSV).
  • Domain, Policy, Target, Gateway(that generated the messages), Message (from policy install), Errorlevel (info, warn, err, etc)

MDSPolicyInstaller.py 

I tried to stay away from doing anything crazy so it should be pretty clear whats going on.

0 Replies