puppet node classifier
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.1 KiB

  1. #!/usr/bin/env python3
  2. import ZODB
  3. import ZODB.FileStorage
  4. # def main():
  5. # storage = ZODB.FileStorage.FileStorage("pupper.db")
  6. # db = ZODB.DB(storage)
  7. # for k, v in db.open().root.nodes.items():
  8. # print(k, v.name, ":", v, "\n\t", v.body, "\n")
  9. # def main():
  10. # storage = ZODB.FileStorage.FileStorage("pupper.db")
  11. # db = ZODB.DB(storage)
  12. # for k, v in db.open().root.nodes["foo2"].classes.items():
  13. # # print(k, v.name, ":", v, "\n\t", v.body, "\n")
  14. # print(v.conf)
  15. def main():
  16. storage = ZODB.FileStorage.FileStorage("pupper.db")
  17. db = ZODB.DB(storage)
  18. with db.transaction() as c:
  19. for host in ("scc", "root", "puppettest5.scc.net.davepedu.com"):
  20. if "foo2" in c.root.nodes[host].classes:
  21. del c.root.nodes[host].classes["foo2"]
  22. # del c.root.nodes["scc"].classes["foo2"]
  23. # def main():
  24. # storage = ZODB.FileStorage.FileStorage("pupper.db")
  25. # db = ZODB.DB(storage)
  26. # with db.transaction() as c:
  27. # print(c.root.nodes["puppettest5.scc.net.davepedu.com"].parents)
  28. if __name__ == "__main__":
  29. main()