Guest User

Untitled

a guest
Aug 28th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. # coding=utf-8
  2.  
  3. from CMDB import Ingress, Egress
  4.  
  5. class MySQL:
  6. def __init__(self, connectionString):
  7. self.connectionString = Egress("database.connectionString", connectionString)
  8.  
  9. def updateConnectionString(self, newConnectionString):
  10. print "MySQL: New connection string is", newConnectionString
  11. self.connectionString.update(newConnectionString)
  12.  
  13. class Pohape:
  14. def __init__(self):
  15. self.connectionString = Ingress("database.connectionString", self.updateConnectionString)
  16.  
  17. def updateConnectionString(self, newConnectionString):
  18. print "Pohape: database connection string changed to", newConnectionString
  19. print "Pohape: Recycling"
  20. return True
  21.  
  22. mysql = MySQL("jdbc://10.8.0.1")
  23. pohape = Pohape()
  24. mysql.updateConnectionString("jdbc://localhost")
  25.  
  26. from CMDB import CMDB
  27. print CMDB.getValueHistory("database.connectionString")
Add Comment
Please, Sign In to add comment