예제 #1
0
 def install(self):
     pres = PkgInstallComponent.install(self)
     #extra actions to ensure we are granted access
     dbtype = self.cfg.get("db", "type")
     dbactions = DB_ACTIONS.get(dbtype)
     if(dbactions and dbactions.get('grant_all')):
         #update the DB to give user 'USER'@'%' full control of the all databases:
         grant_cmd = dbactions.get('grant_all')
         params = self._get_param_map()
         cmds = list()
         cmds.append({
             'cmd': grant_cmd,
             'run_as_root': False,
         })
         #shell seems to be needed here
         #since python escapes this to much...
         execute_template(*cmds, params=params, shell=True)
     #special mysql actions
     if(dbactions and dbtype == MYSQL):
         cmd = dbactions.get('host_adjust')
         if(cmd):
             execute(*cmd, run_as_root=True, shell=True)
     #restart it to make sure all good
     self.runtime.restart()
     return pres
예제 #2
0
 def install(self):
     pres = PkgInstallComponent.install(self)
     #ensure setup right
     self._setup_pw()
     #restart it to make sure its ok to go
     self.runtime.restart()
     return pres
예제 #3
0
 def install(self):
     pres = PkgInstallComponent.install(self)
     #extra actions to ensure we are granted access
     dbtype = self.cfg.get("db", "type")
     dbactions = DB_ACTIONS.get(dbtype)
     if (dbactions and dbactions.get('grant_all')):
         #update the DB to give user 'USER'@'%' full control of the all databases:
         grant_cmd = dbactions.get('grant_all')
         params = self._get_param_map()
         cmds = list()
         cmds.append({
             'cmd': grant_cmd,
             'run_as_root': False,
         })
         #shell seems to be needed here
         #since python escapes this to much...
         execute_template(*cmds, params=params, shell=True)
     #special mysql actions
     if (dbactions and dbtype == MYSQL):
         cmd = dbactions.get('host_adjust')
         if (cmd):
             execute(*cmd, run_as_root=True, shell=True)
     #restart it to make sure all good
     self.runtime.restart()
     return pres
예제 #4
0
 def install(self):
     pres = PkgInstallComponent.install(self)
     #ensure setup right
     self._setup_pw()
     #restart it to make sure its ok to go
     self.runtime.restart()
     return pres
예제 #5
0
 def __init__(self, *args, **kargs):
     PkgInstallComponent.__init__(self, TYPE, *args, **kargs)
     self.runtime = DBRuntime(*args, **kargs)
예제 #6
0
 def __init__(self, *args, **kargs):
     PkgInstallComponent.__init__(self, TYPE, *args, **kargs)
     self.runtime = DBRuntime(*args, **kargs)