Ejemplo n.º 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
Ejemplo n.º 2
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
Ejemplo n.º 3
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
Ejemplo n.º 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